PHP_CodeSniffer rules for Yoast projects
Yoast Coding Standards (YoastCS) is a project with rulesets for code style and quality tools to be used in Yoast projects.
Standards are provided as Composer package and can be installed with:
composer create-project yoast/yoastcs:dev-master
Composer will automatically install dependencies, register standards paths, and set default PHP Code Sniffer standard to
To include standards as part of a project require them as development dependencies:
composer require yoast/yoastcs:dev-master --dev
Note that Composer won't run configuration scripts in this scenario and the root project needs to take care of it.
Set of PHP Code Sniffer rules.
- error level issues are considered mandatory to fix in Yoast projects and enforced in continuous integration
- warning level issues are considered recommended to fix
"vendor/bin/phpcs" --extensions=php /path/to/folder/
Refer to Using PHP Code Sniffer Tool in PhpStorm documentation.
Yoast standard will be available as a choice in PHP Code Sniffer Validation inspection.
The changelog for this package can be found in the CHANGELOG.md file.