PHPackages                             m6web/coke - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. m6web/coke

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

m6web/coke
==========

PHP Code Sniffer configurator

v2.2.0(9y ago)67390.8k↑52.9%920MITShell

Since Dec 9Pushed 8y ago33 watchersCompare

[ Source](https://github.com/BedrockStreaming/Coke)[ Packagist](https://packagist.org/packages/m6web/coke)[ RSS](/packages/m6web-coke/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (11)Used By (20)

Coke - Enjoy sniffing your code
===============================

[](#coke---enjoy-sniffing-your-code)

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

Configuration file
------------------

[](#configuration-file)

Create a `.coke` file at your project root :

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

# Path used to load Standards (optional)
standard-path=path/to/PHPCS/Standards/

# Standard used by PHP CodeSniffer (required)
standard=Symfony2

# Verbose mode (optional - default: false)
verbose=true

# Only Git changed mode (optional - default: false)
only-git-changed=true

# White list of files and directories (optional)
src/
test.php

# Black list of files and directories (optional)
!Tests
!src/OldFile.php

```

and just launch the command :

```
$ coke
```

Run the command with arguments
------------------------------

[](#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
`--only-git-changed` Check only changed files
`-v` Use verbose mode

Additional arguments
--------------------

[](#additional-arguments)

You can use any phpcs arguments ([documentation](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options))

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
-------------------------

[](#installation-via-composer)

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

```
"require-dev": {
    "m6web/coke" : "~2.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](http://getcomposer.org/doc/articles/vendor-binaries.md)) :

```
"config": {
    "bin-dir": "bin"
}

```

Then you can call coke via :

```
./bin/coke

```

Git pre-commit hook
-------------------

[](#git-pre-commit-hook)

You can use a dedicated [pre-commit hook](https://gist.github.com/JJK801/5867810) :

```
$ wget --output-document=.git/hooks/pre-commit https://gist.githubusercontent.com/JJK801/5867810/raw/f26ec4778273b3f7140428252ab31951de2faba4/pre-commit.sh

```

Or

```
$ curl -L https://gist.githubusercontent.com/JJK801/5867810/raw/f26ec4778273b3f7140428252ab31951de2faba4/pre-commit.sh > .git/hooks/pre-commit

```

Then

```
$ chmod +x .git/hooks/pre-commit

```

Credits
-------

[](#credits)

Developped by the [Cytron Team](http://cytron.fr/) of [M6 Web](http://tech.m6web.fr/).

License
-------

[](#license)

Coke is licensed under the [MIT license](LICENSE).

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community38

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~139 days

Recently: every ~231 days

Total

10

Last Release

3290d ago

Major Versions

v1.2.2 → v2.0.02015-04-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2069361?v=4)[Patrick](/maintainers/Bedrock)[@Bedrock](https://github.com/Bedrock)

---

Top Contributors

[![KuiKui](https://avatars.githubusercontent.com/u/748924?v=4)](https://github.com/KuiKui "KuiKui (14 commits)")[![agallou](https://avatars.githubusercontent.com/u/320372?v=4)](https://github.com/agallou "agallou (6 commits)")[![mikaelrandy](https://avatars.githubusercontent.com/u/187703?v=4)](https://github.com/mikaelrandy "mikaelrandy (4 commits)")[![nchaulet](https://avatars.githubusercontent.com/u/1336873?v=4)](https://github.com/nchaulet "nchaulet (2 commits)")[![omansour](https://avatars.githubusercontent.com/u/1131098?v=4)](https://github.com/omansour "omansour (2 commits)")[![peikk0](https://avatars.githubusercontent.com/u/1555947?v=4)](https://github.com/peikk0 "peikk0 (2 commits)")[![adriensamson](https://avatars.githubusercontent.com/u/520234?v=4)](https://github.com/adriensamson "adriensamson (1 commits)")[![vdechenaux](https://avatars.githubusercontent.com/u/1501825?v=4)](https://github.com/vdechenaux "vdechenaux (1 commits)")[![b-viguier](https://avatars.githubusercontent.com/u/5537799?v=4)](https://github.com/b-viguier "b-viguier (1 commits)")[![fdubost](https://avatars.githubusercontent.com/u/3973818?v=4)](https://github.com/fdubost "fdubost (1 commits)")[![JEDIBC](https://avatars.githubusercontent.com/u/292261?v=4)](https://github.com/JEDIBC "JEDIBC (1 commits)")[![marmotz](https://avatars.githubusercontent.com/u/932553?v=4)](https://github.com/marmotz "marmotz (1 commits)")[![romainPrignon](https://avatars.githubusercontent.com/u/2632192?v=4)](https://github.com/romainPrignon "romainPrignon (1 commits)")

### Embed Badge

![Health badge](/badges/m6web-coke/health.svg)

```
[![Health](https://phpackages.com/badges/m6web-coke/health.svg)](https://phpackages.com/packages/m6web-coke)
```

###  Alternatives

[shopsys/coding-standards

Coding standards definition compatible with PSR-2

20269.1k13](/packages/shopsys-coding-standards)[flyeralarm/php-code-validator

A custom coding standard for FLYERALARM

2226.9k6](/packages/flyeralarm-php-code-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
