greencape / coding-standards
Composer installable Coding Standards Definitions.
Installs: 2 006
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 126
Open Issues: 2
pkg:composer/greencape/coding-standards
This package is auto-updated.
Last update: 2025-10-29 01:50:59 UTC
README
This repository includes Coding Standard definitions for PHP CodeSniffer 2.x for use with Composer.
Currently, these Coding Standards are included:
- Joomla! Coding Standard
 - WordPress Coding Standard
 - PEAR, PSR1, PSR2, Squiz, and Zend Coding Standards are provided by PHP CodeSniffer natively.
 
Requirements
- PHP 5.3+
 - Composer
 
Installation
Add this package to your requirements.
$ composer require --dev greencape/coding-standards:~1
The PHP CodeSniffer tool is installed automatically in a matching version.
You can verify a successful install with
$ ./vendor/bin/phpcs -i The installed coding standards are MySource, PSR2, Squiz, Zend, PHPCS, PSR1, PEAR, WordPress and Joomla
Running
You can use the installed Joomla standard like:
$ ./vendor/bin/phpcs --standard=Joomla path/to/code $ ./vendor/bin/phpcbf --standard=Joomla path/to/code
You can use the installed WordPress standard like:
$ ./vendor/bin/phpcs --standard=WordPress path/to/code $ ./vendor/bin/phpcbf --standard=WordPress path/to/code
In both cases, the second (phpcbf) line will fix some issues automatically.
However, this part is work in progress, and will improve over time.
Contributing
If you want to contribute to this project, you can
- fork this repo, code, and send a Pull Request
 - file an issue in the Issue Tracker