sun-asterisk / coding-standard
Sun* R&D PHP coding standard
Installs: 36 071
Dependents: 2
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 3
Open Issues: 0
Type:phpcodesniffer-standard
Requires
- php: >=7.1
- dealerdirect/phpcodesniffer-composer-installer: ^0.7.2
- slevomat/coding-standard: ^6.4
- squizlabs/php_codesniffer: ^3.7
README
Sun* coding standard for PHP_CodeSniffer.
Installation
Using composer
composer require --dev sun-asterisk/coding-standard
Usage
Add the SunAsterisk
standard to your project's phpcs.xml
:
<?xml version="1.0" encoding="UTF-8"?> <ruleset name="YourProject" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <rule ref="SunAsterisk"/> </ruleset>
Or use it on the command line
vendor/bin/phpcs --standard=SunAsterisk <file or directory to check>
Laravel
The SunAsteriskLaravel
standard is extended for Laravel projects.
You can use it as below:
<?xml version="1.0" encoding="UTF-8"?> <ruleset name="YourProject" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <file>app</file> <file>config</file> <file>database</file> <file>resources</file> <file>routes</file> <file>tests</file> <exclude-pattern>vendor/</exclude-pattern> <rule ref="SunAsteriskLaravel"/> </ruleset>
Refer to the phpcs documents for more detailed usage. Also refer to slevomat/coding-standard for details on some sniffs.