Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
php-cs-fixer

PHP-CS-FIXER

This tool checks for PSR code styling. More info

Usage

Installation

We download it to /usr/local/bin/

sudo curl http://get.sensiolabs.org/php-cs-fixer.phar -o /usr/local/bin/php-cs-fixer

We now make php-cs-fixer a global object.

sudo chmod a+x /usr/local/bin/php-cs-fixer

Then, just run php-cs-fixer.

Usage

Check a file or an entire folder

php-cs-fixer fix ~/Documents/my-repos/social-media-facebook/jeroendesloovere --level=psr2

More info

When you accidently didn't used the --level=psr-2, spaces are removed in concatenation. Spaces can be added againg by using:

php-cs-fixer fix backend/modules/whitepapers --fixers=concat_with_spaces

"Concatenation should be used with at least one whitespace around.", more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.