Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Coding Standards for Lazy PHP Devs
export PATH=~/.composer/vendor/bin:$PATH
composer global require "squizlabs/php_codesniffer=*";
# Check and Beautify
# - Ignore some commonly ignored things (composer folder, blade templates, ...)
phpcs ./ --ignore=test-reports,vendor,*.blade.php --standard=psr2,psr1 --report=summary
phpcbf ./ --ignore=test-reports,vendor,*.blade.php --standard=psr2,psr1 --report=summary
# - Laravel 5: Doesn't check /bootstrap or /database but does beautify
phpcs ./app --standard=psr2,psr1 --report=summary;
phpcs ./config --standard=psr2,psr1 --report=summary;
phpcs ./public/index.php --standard=psr2,psr1 --report=summary;
phpcbf ./app --standard=psr2,psr1;
phpcbf ./bootstrap --standard=psr2,psr1;
phpcbf ./config --standard=psr2,psr1;
phpcbf ./database --standard=psr2,psr1;
phpcbf ./public/index.php --standard=psr2,psr1;
phpcbf ./server.php --standard=psr2,psr1;
phpcs ./app --standard=psr2,psr1;
phpcs ./config --standard=psr2,psr1;
phpcs ./public/index.php --standard=psr2,psr1;
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.