PHPackages                             cakephp/cakephp-codesniffer - 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. [Framework](/categories/framework)
4. /
5. cakephp/cakephp-codesniffer

ActivePhpcodesniffer-standard[Framework](/categories/framework)

cakephp/cakephp-codesniffer
===========================

CakePHP CodeSniffer Standards

5.3.0(8mo ago)23711.0M—7.9%83[1 issues](https://github.com/cakephp/cakephp-codesniffer/issues)[1 PRs](https://github.com/cakephp/cakephp-codesniffer/pulls)20MITPHPPHP &gt;=8.1CI passing

Since May 22Pushed 2mo ago32 watchersCompare

[ Source](https://github.com/cakephp/cakephp-codesniffer)[ Packagist](https://packagist.org/packages/cakephp/cakephp-codesniffer)[ Docs](https://cakephp.org)[ RSS](/packages/cakephp-cakephp-codesniffer/feed)WikiDiscussions 5.x Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (85)Used By (20)

CakePHP Code Sniffer
====================

[](#cakephp-code-sniffer)

[![Build Status](https://github.com/cakephp/cakephp-codesniffer/actions/workflows/ci.yml/badge.svg?branch=5.next)](https://github.com/cakephp/cakephp-codesniffer/actions/workflows/ci.yml/badge.svg?branch=5.next)[![Total Downloads](https://camo.githubusercontent.com/ea0c20d4281dd7f7e4b458f4378a5a90955ef85f7d61aaa9eaa9b58db477ffc9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616b657068702f63616b657068702d636f6465736e69666665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cakephp/cakephp-codesniffer)[![Latest Stable Version](https://camo.githubusercontent.com/5f4fc02fbfaa2af2aafa56795604a46462a7af4d6271ec9228fabc36015cd254/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63616b657068702f63616b657068702d636f6465736e69666665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cakephp/cakephp-codesniffer)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

This code works with [squizlabs/php\_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer)and checks code against the coding standards used in CakePHP.

This sniffer package follows [PSR-12](https://www.php-fig.org/psr/psr-12/) completely and ships with a lot of additional fixers on top.

[List of included sniffs](/docs)

Which version should I use?
---------------------------

[](#which-version-should-i-use)

See [version map](https://github.com/cakephp/cakephp-codesniffer/wiki).

Installation
------------

[](#installation)

You should install this codesniffer with composer:

```
composer require --dev cakephp/cakephp-codesniffer
vendor/bin/phpcs --config-set installed_paths /path/to/your/app/vendor/cakephp/cakephp-codesniffer

```

The second command lets `phpcs` know where to find your new sniffs. Ensure that you do not overwrite any existing `installed_paths` value. Alternatively, install the [`dealerdirect/phpcodesniffer-composer-installer`](https://github.com/Dealerdirect/phpcodesniffer-composer-installer)composer package which will handle configuring the `phpcs` `installed_paths` for you.

Usage
-----

[](#usage)

⚠️ Warning when these sniffs are installed with composer, ensure that you have configured the CodeSniffer `installed_paths` setting.

Depending on how you installed the code sniffer changes how you run it. If you have installed phpcs, and this package with PEAR, you can do the following:

```
vendor/bin/phpcs --colors -p -s --standard=CakePHP /path/to/code/

```

You can also copy the `phpcs.xml.dist` file to your project's root folder as `phpcs.xml`. This file will import the CakePHP Coding Standard. From there you can edit it to include/exclude as needed. With this file in place, you can run:

```
vendor/bin/phpcs --colors -p -s /path/to/code/

```

If you are using Composer to manage your CakePHP project, you can also add the below to your composer.json file:

```
{
    "scripts": {
        "cs-check": "vendor/bin/phpcs --colors -p -s --extensions=php src/ tests/"
    }
}
```

Running Tests
-------------

[](#running-tests)

You can run tests with composer. Because of how PHPCS test suites work, there is additional configuration state in `phpcs` that is required.

```
composer test
```

Once this has been done once, you can use `composer phpunit` to run the tests for the rules in this repository.

The tests are present inside the `CakePHP/Tests/` folder.

Contributing
------------

[](#contributing)

If you'd like to contribute to the Code Sniffer, you can fork the project add features and send pull requests.

Note

Please make sure to run `composer docs` if you change the ruleset.xml file.

Releasing CakePHP Code Sniffer
------------------------------

[](#releasing-cakephp-code-sniffer)

- Create a signed tag
- Write the changelog in the tag commit

###  Health Score

73

—

ExcellentBetter than 100% of packages

Maintenance76

Regular maintenance activity

Popularity66

Solid adoption and visibility

Community55

Growing community involvement

Maturity87

Battle-tested with a long release history

 Bus Factor3

3 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 ~54 days

Recently: every ~63 days

Total

80

Last Release

65d ago

Major Versions

1.x-dev → 3.x-dev2023-03-25

3.x-dev → 5.1.12023-04-09

4.7.0 → 5.1.22024-08-03

4.7.1 → 5.3.02025-09-19

5.x-dev → 6.x-dev2026-03-14

PHP version history (7 changes)2.3.0PHP &gt;=5.4

3.1.0PHP &gt;=5.6

4.0.0-beta1PHP ^7.1

4.1.0PHP ^7.2

4.2.3PHP &gt;=7.2.0

5.1.1PHP &gt;=8.1.0

5.3.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23666?v=4)[CakePHP](/maintainers/cakephp)[@cakephp](https://github.com/cakephp)

---

Top Contributors

[![markstory](https://avatars.githubusercontent.com/u/24086?v=4)](https://github.com/markstory "markstory (201 commits)")[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (171 commits)")[![othercorey](https://avatars.githubusercontent.com/u/24221186?v=4)](https://github.com/othercorey "othercorey (111 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (100 commits)")[![antograssiot](https://avatars.githubusercontent.com/u/4977112?v=4)](https://github.com/antograssiot "antograssiot (54 commits)")[![bcrowe](https://avatars.githubusercontent.com/u/752603?v=4)](https://github.com/bcrowe "bcrowe (49 commits)")[![ceeram](https://avatars.githubusercontent.com/u/111448?v=4)](https://github.com/ceeram "ceeram (21 commits)")[![jrbasso](https://avatars.githubusercontent.com/u/26548?v=4)](https://github.com/jrbasso "jrbasso (18 commits)")[![lorenzo](https://avatars.githubusercontent.com/u/37621?v=4)](https://github.com/lorenzo "lorenzo (15 commits)")[![AD7six](https://avatars.githubusercontent.com/u/33387?v=4)](https://github.com/AD7six "AD7six (15 commits)")[![PhantomWatson](https://avatars.githubusercontent.com/u/1965565?v=4)](https://github.com/PhantomWatson "PhantomWatson (14 commits)")[![dakota](https://avatars.githubusercontent.com/u/83255?v=4)](https://github.com/dakota "dakota (8 commits)")[![LordSimal](https://avatars.githubusercontent.com/u/9105243?v=4)](https://github.com/LordSimal "LordSimal (6 commits)")[![rchavik](https://avatars.githubusercontent.com/u/39490?v=4)](https://github.com/rchavik "rchavik (4 commits)")[![tersmitten](https://avatars.githubusercontent.com/u/3392962?v=4)](https://github.com/tersmitten "tersmitten (4 commits)")[![ravage84](https://avatars.githubusercontent.com/u/625761?v=4)](https://github.com/ravage84 "ravage84 (4 commits)")[![TiuTalk](https://avatars.githubusercontent.com/u/145339?v=4)](https://github.com/TiuTalk "TiuTalk (3 commits)")[![cleptric](https://avatars.githubusercontent.com/u/6617432?v=4)](https://github.com/cleptric "cleptric (3 commits)")[![raul338](https://avatars.githubusercontent.com/u/7199046?v=4)](https://github.com/raul338 "raul338 (3 commits)")[![derekperkins](https://avatars.githubusercontent.com/u/3588778?v=4)](https://github.com/derekperkins "derekperkins (3 commits)")

---

Tags

frameworkcodesniffer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cakephp-cakephp-codesniffer/health.svg)

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

###  Alternatives

[spryker/code-sniffer

Spryker Code Sniffer Standards

374.1M2.3k](/packages/spryker-code-sniffer)[yiisoft/yii2-coding-standards

Yii PHP Framework Version 2 - Coding standard tools

1831.0M165](/packages/yiisoft-yii2-coding-standards)[silverstripe/behat-extension

SilverStripe framework extension for Behat

32564.2k5](/packages/silverstripe-behat-extension)[linnk/allman-codesniffer

Allman CodeSniffer &amp; Linnk Standards

121.8k](/packages/linnk-allman-codesniffer)

PHPackages © 2026

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