This project makes custom PHP code sniffs available to your project
These instructions will allow you to import this project's sniffs into your own project
composer require --dev squizlabs/phpcs
For more information, see https://github.com/squizlabs/PHP_CodeSniffer/
In your composer.json
file, add https://github.com/jroman00/php-coding-standards.git
as a custom VCS:
"repositories": [{
"type": "vcs",
"url": "https://github.com/jroman00/php-coding-standards.git"
}],
Import this project via composer, by running the following:
composer require --dev jroman00/php-coding-standards
In your ruleset.xml
, add the following:
- An entry for
installed_paths
for this library - A rule for this library
<?xml version="1.0"?>
<ruleset>
<description>Coding standards</description>
<!-- jroman00/php-coding-standards -->
<config name="installed_paths" value="vendor/jroman00/php-coding-standards" />
<!-- Jroman00 -->
<rule ref="Jroman00" />
<!-- Additional configs can go here -->
<!-- ... -->
</ruleset>
For more information, see PHP_CodeSniffer's Annotated ruleset.xml
./vendor/bin/phpcs -p --standard=./ruleset.xml src/
When contributing to this repository, please first discuss the change you wish to make via an issue, an email, or any other method with the owners of this repository before making a change
Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md for more details