Package Data | |
---|---|
Maintainer Username: | wsaleme |
Maintainer Contact: | it@chefsplate.com (ChefsPlate Development Team) |
Package Create Date: | 2017-07-05 |
Package Last Update: | 2017-07-05 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-16 15:00:38 |
Package Statistics | |
---|---|
Total Downloads: | 2,517 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 4 |
Total Forks: | 0 |
Total Open Issues: | 6 |
This is a Laravel 4/5 package that hooks up SquizLabs CodeSniffer 2 into Laravel-based apps. It can also be used manually, so read on.
Detect violations of a defined coding standard. It helps your code remain clean and consistent. Available options are: PSR2, PSR1, Zend, PEAR, Squiz, PHPCS and ChefsPlate.
Require this package in composer:
$ composer require chefsplate/sniffer-rules
In your config/app.php
add ChefsPlate\SnifferRules\ServiceProvider:class
to $providers
array:
'providers' => [
...
ChefsPlate\SnifferRules\ServiceProvider::class,
...
],
$ php artisan vendor:publish
Copy config to
app/config/sniffer-rules.php
Edit configuration file config/sniffer-rules.php
to tweak the sniffer behavior.
Install our Standard by configuring PHP_CodeSniffer to look for it.
$ php ./vendor/bin/phpcs --config-set installed_paths ./vendor/chefsplate/src/ChefsPlate/SnifferRules/Standard/
$ php artisan sniff
To run the sniffer in a CI environment, the -n
option should be set to remove
interaction:
$ php artisan sniff -n
$ php ./vendor/bin/phpcs --standard=ChefsPlate path/to/code
It's encouraged to add a Makefile
to your project that makes it
trivial for other developers. Use Makefile
in this directory and adjust as
needed to fit your project requirements.
namespace
should be on the same line as opening php tag. e.g.: <?php namespace ChefsPlate\Amazing
test_cats_love_catnip
MIT