LinuxCommandLibrary

php-cs-fixer

fixes PHP coding standards

TLDR

Fix current directory

$ php-cs-fixer fix
copy
Fix specific file
$ php-cs-fixer fix [file.php]
copy
Dry run
$ php-cs-fixer fix --dry-run
copy
Show diff
$ php-cs-fixer fix --diff
copy
Use specific rules
$ php-cs-fixer fix --rules=@PSR12
copy

SYNOPSIS

php-cs-fixer [command] [options]

DESCRIPTION

php-cs-fixer fixes PHP coding standards. Enforces consistent style.
The tool automatically formats code. Supports PSR standards.

PARAMETERS

fix [PATH]

Fix coding standards.
--dry-run
Don't modify files.
--diff
Show changes.
--rules RULES
Coding standard rules.
--config FILE
Configuration file.
--help
Display help.

CAVEATS

Configuration via .php-cs-fixer.php. Rule sets customizable.

HISTORY

PHP CS Fixer was created for automatic PHP coding standards enforcement.

SEE ALSO

phpcs(1), phpcbf(1), php(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community