LinuxCommandLibrary

phpcbf

TLDR

Fix coding standards

$ phpcbf [file.php]
copy
Fix directory
$ phpcbf [src/]
copy
Use specific standard
$ phpcbf --standard=PSR12 [file.php]
copy
Fix specific sniffs
$ phpcbf --sniffs=[Sniff.Name] [file.php]
copy
Dry run
$ phpcbf -n [file.php]
copy

SYNOPSIS

phpcbf [options] [files...]

DESCRIPTION

phpcbf is PHP Code Beautifier and Fixer. Fixes coding standard violations.
The tool auto-corrects style issues. Companion to phpcs.
phpcbf fixes PHP style.

PARAMETERS

FILES

Files or directories.
--standard NAME
Coding standard.
--sniffs LIST
Specific sniffs.
-n
Do not apply changes.
--help
Display help.

CAVEATS

Part of PHP_CodeSniffer. Not all issues fixable.

HISTORY

PHPCBF is part of PHP_CodeSniffer for automatic code fixing.

SEE ALSO

Copied to clipboard