nicwortel / coding-standard
My ruleset for PHP CodeSniffer
Installs: 5 127
Dependents: 3
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:phpcodesniffer-standard
Requires
- php: ^8.1
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- slevomat/coding-standard: ^8.9
- squizlabs/php_codesniffer: ^3.7
Requires (Dev)
- liip/rmt: ^1.6
README
This is my ruleset for PHP CodeSniffer. It's based on the PSR-12 Extended Coding Style, enhanced with sniffs from the Slevomat Coding Standard.
Installation
composer require --dev squizlabs/php_codesniffer nicwortel/coding-standard
Usage
Create a phpcs.xml
file:
<?xml version="1.0" encoding="UTF-8"?> <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"> <arg name="basepath" value="."/> <arg name="cache" value=".phpcs-cache"/> <arg name="colors"/> <arg name="extensions" value="php"/> <!-- Show progress and sniff names --> <arg value="ps" /> <file>src/</file> <rule ref="NicWortel"/> </ruleset>
Then you can run vendor/bin/phpcs
.