Hyvä Themes PHP_CodeSniffer coding standard distribution for Webgriffe projects.
Repackages hyva-themes/hyva-coding-standard with minimal dependencies to avoid version conflicts when installed alongside Magento.
composer require --dev webgriffe/hyva-coding-standard-distComposer will prompt you to allow the dealerdirect/phpcodesniffer-composer-installer plugin
(one-time), or add it upfront to your project's composer.json:
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}The dealerdirect plugin automatically registers the HyvaThemes and Magento2 standards
in phpcs on every composer install / composer update.
vendor/bin/phpcs --standard=HyvaThemes app/code/path/to/checkIf your project's composer.json already has a post-install-cmd / post-update-cmd script
that calls phpcs --config-set installed_paths ... directly, it runs after the dealerdirect
plugin and overwrites the registered paths. Fix: append vendor/webgriffe/hyva-coding-standard-dist
to that list:
"post-install-cmd": [
"[ -f vendor/bin/phpcs ] && vendor/bin/phpcs --config-set installed_paths vendor/magento/magento-coding-standard,...,vendor/webgriffe/hyva-coding-standard-dist || true"
]