PHP Code Sniffer configurator

Installs: 42 565

Dependents: 36

Stars: 52

Watchers: 16

Forks: 10

Open Issues: 1

Language: Shell

v2.1.0 2015-07-27 20:30 UTC


Coke is a Shell/Bash command using PHP Code Sniffer allowing rules management per project.

Configuration file

Create a .coke file at your project root :

# Command used to launch PHP CodeSniffer (optional - default: phpcs)

# Path used to load Standards (optional)

# Standard used by PHP CodeSniffer (required)

# Verbose mode (optional - default: false)

# White list of files and directories (optional)

# Black list of files and directories (optional)

and just launch the command :

$ coke

Run the command with arguments

You can override .coke settings by passing directly configuration as arguments to the command :

$ coke src test.php --standard=Symfony2 --ignore=Tests,src/OldFile.php -v

The order of arguments is not important

src test.php Files/Directories to include in the check
--standard=Symfony2 Standard to use for check
--ignore=Tests,src/OldFile.php URL patterns to ignore in the check
-v Use verbose mode

Additional arguments

You can use any phpcs arguments (documentation)

For example if you want to generate a report with your favorite CI tools you can run

$ coke --report-checkstyle=checkstyle.xml

Installation via composer

Add coke in the require-dev section of your composer.json :

"require-dev": {
    "m6web/coke" : "~1.0"

By default composer will add a symlink to coke in vendor/bin/coke.

If you want to change it, add this in your composer.json (more information about this in the composer documentation) :

"config": {
    "bin-dir": "bin"

Then you can call coke via :



Developped by the Cytron Team of M6 Web.


Coke is licensed under the MIT license.