This tool checks for PSR code styling. More info
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
.
Check a file or an entire folder
php-cs-fixer fix ~/Documents/my-repos/social-media-facebook/jeroendesloovere --level=psr2
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