wpscholar / phpcs-standards-installer
A custom Composer installer for PHP Code Sniffer standards.
Installs: 291
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:composer-plugin
Requires
- composer-plugin-api: ^1.1
- pimple/pimple: ^3.2
This package is auto-updated.
Last update: 2024-11-21 22:07:39 UTC
README
A Composer plugin that properly registers PHP Code Sniffer standards. Visit the PHP Code Sniffer coding standard tutorial to find out more about creating custom coding standards/rulesets.
Create an Installable Coding Standard
- Create a repository for hosting your PHP Code Sniffer coding standard.
- Set the type as
phpcs-standards
in your composer.json file. - Require PHP Code Sniffer and this installer as dependencies in your composer.json file:
"type": "phpcs-standards", "require": { "squizlabs/php_codesniffer": "^2.9.2", "wpscholar/phpcs-standards-installer": "^1.0" }
Usage
- Require any Composer package of type
phpcs-standards
. - Optionally add any PHP Code Sniffer config options to the
extra
section in your composer.json file
"require": { "wpscholar/phpcs-standards-wpscholar": "^1.0" }, "extra": { "phpcs-config": { "default_standard": "WPScholar", "testVersion": "5.4-" } }
- Run
composer install
!
IDE Integration
Some IDE integrations of PHPCS will fail to register your ruleset since it doesn't live in your project root. In order to rectify this, place phpcs.xml at your project root:
<?xml version="1.0"?> <ruleset name="Project Rules"> <rule ref="WPScholar" /> </ruleset>