webdevstudios / php-coding-standards
In-house PHP linting and coding standards for WebDevStudios
Installs: 4 484
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 0
Open Issues: 20
Type:phpcodesniffer-standard
Requires
This package is not auto-updated.
Last update: 2021-05-09 21:36:04 UTC
README
WebDevStudios PHP Coding Standards
Install
To install in your project, use:
composer require webdevstudios/php-coding-standards:~1.3.0 --dev
Then add a .phpcs.xml.dist
file to your project:
<?xml version="1.0"?> <ruleset name="Project"> <rule ref="WebDevStudios"/> </ruleset>
To do this quickly, run:
echo '<?xml version="1.0"?><ruleset name="Project"><rule ref="WebDevStudios"/></ruleset>' > .phpcs.xml.dist
Installation will automatically install WebDevStudios
standard for vendor/bin/phpcs
.
CLI Linting
Lint a single file
./vendor/bin/phpcs -s path/to/file.php
Lint multiple files
./vendor/bin/phpcs -s --extensions=php /path/to/dir
Editor Linting
In your favorite editor install it's phpcs
package and it will automatically detect your phpcs.xml.dist
file and lint any PHP file you have open. You may need to re-configure your settings if you are moving from WDS-Coding-Standards.