pieceofcake2 / phpcs-cakephp2
PHP_CodeSniffer ruleset for CakePHP 2 applications and plugins, based on the CakePHP coding standard
Package info
github.com/pieceofcake2/phpcs-cakephp2
Type:phpcodesniffer-standard
pkg:composer/pieceofcake2/phpcs-cakephp2
Requires
- php: >=8.0
- cakephp/cakephp-codesniffer: ^5.0
- slevomat/coding-standard: ^8.0
Requires (Dev)
- phpunit/phpunit: ^9.6
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-16 09:34:34 UTC
README
A PHP_CodeSniffer standard for CakePHP 2
applications and plugins running on pieceofcake2/cakephp.
It is the CakePHP standard of
cakephp/cakephp-codesniffer 5.x, with the
exceptions that CakePHP 2 code needs: no namespaces, App::uses(), underscored controller
actions, DATABASE_CONFIG and no native types in signatures. The CakePHP rules are used as
they are, not copied, so their updates arrive with cakephp/cakephp-codesniffer.
Documentation
- Website: https://pieceofcake2.github.io/phpcs-cakephp2/ (日本語: https://pieceofcake2.github.io/phpcs-cakephp2/ja/)
- Markdown: docs/README.md (日本語: docs/ja/README.md) (for AI tools and offline reading)
The Markdown documentation is also included in the Composer package, at vendor/pieceofcake2/phpcs-cakephp2/docs/README.md. Install the package with --dev if you only need it for development.
Requirements
- PHP 8.1+ to run PHP_CodeSniffer (installable on PHP 8.0)
- cakephp/cakephp-codesniffer 5.x
Installation
composer require --dev pieceofcake2/phpcs-cakephp2
Allow the dealerdirect/phpcodesniffer-composer-installer plugin when Composer asks. Then use
the standard in your phpcs.xml:
<?xml version="1.0"?> <ruleset> <file>./src</file> <file>./tests</file> <rule ref="CakePHP2"/> </ruleset>
Contributing
See the contribution guidelines.
License
Licensed under the MIT License. See LICENSE.