LinuxCommandLibrary

php-cs-fixer

Automatic coding style fixer for PHP.

TLDR

Execute code style fixing in the current directory

$ php-cs-fixer fix
copy


Execute code style fixing for a specific directory
$ php-cs-fixer fix [path/to/directory]
copy


Execute code style linting without applying changes
$ php-cs-fixer fix --dry-run
copy


Execute code style fixes using specific rules
$ php-cs-fixer fix --rules=[rules]
copy


Display the rules that have been applied
$ php-cs-fixer fix --verbose
copy


Output the results in a different format
$ php-cs-fixer fix --format=[txt|json|xml|checkstyle|junit|gitlab]
copy


Display files that require fixing
$ php-cs-fixer list-files
copy


Describe a rule or ruleset
$ php-cs-fixer describe [rule]
copy

Copied to clipboard