Skip to content

Instantly share code, notes, and snippets.

@nojacko
Last active August 29, 2015 14:08
Show Gist options
  • Save nojacko/ccf52cd5efec06297524 to your computer and use it in GitHub Desktop.
Save nojacko/ccf52cd5efec06297524 to your computer and use it in GitHub Desktop.
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