Last active
August 29, 2015 14:08
-
-
Save nojacko/ccf52cd5efec06297524 to your computer and use it in GitHub Desktop.
Coding Standards for Lazy PHP Devs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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