The coding standard used for WordPress sites.
Standards are provided as a Composer package and can be installed with:
composer create-project isotopsweden/isotopcs:dev-master
Composer will automatically install dependencies, register standards paths, and set default PHP Code Sniffer standard to Isotop
.
You should update minimum-stability
to dev
and set prefer-stable
to true
.
{
"minimum-stability": "dev",
"prefer-stable": true
}
Then you can install isotopcs
as a dependency.
composer require isotopsweden/isotopcs:dev-master --dev
vendor/bin/phpcs --extensions=php /path/to/folder/
Use linter-phpcs.
{
"phpcs_executable_path": "/path/to/isotopcs/vendor/bin/phpcs",
"phpcs_additional_args": {
"--standard": "Isotop"
}
}
Refer to Using PHP Code Sniffer Tool in PhpStorm documentation.
After installation Isotop
standard will be available as a choice in PHP Code Sniffer Validation inspection.