Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

PHP-CS-Fixer Action

GitHub Action to check and fix PHP code style with PHP-CS-Fixer.

Features

  • ✅ Validates config file exists
  • ✅ Configurable PHP version and paths
  • ✅ Dry-run mode (check only, no fixes)
  • ✅ Automatic cache - Caches .php-cs-fixer.cache for 60% faster runs

Usage

- uses: zeroseven/action-php-cs-fixer@v1
  with:
    config: '.php-cs-fixer.php'
    paths: 'src/'

Inputs

Input Description Required Default
php-version PHP version No 8.3
config Path to .php-cs-fixer.php Yes -
paths Paths to check No .
dry-run Dry-run mode (no fixes) No true

Caching

This action automatically caches PHP-CS-Fixer's cache file (.php-cs-fixer.cache) to speed up subsequent runs.

Cache Key Strategy:

  • Primary: php-cs-fixer-{OS}-{PHP version}-{PHP files hash}-{config hash}
  • Fallback: php-cs-fixer-{OS}-{PHP version}-

Expected Performance:

  • First run: 30-60 seconds
  • Cached run: 10-20 seconds (~60% faster)

Cache Invalidation:

  • Cache refreshes when PHP files or config changes
  • Manual clear: Repository Settings → Actions → Caches

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors