Search by

pieceofcake2 / phpcs-cakephp2

ttsuru

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

Statistics

Installs: 8 861

Dependents: 33

Suggesters: 0

Stars: 0

v1.1.1 2026-10-16 05:53 UTC

README

GitHub License Packagist Version PHP CI

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

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.