webgriffe/hyva-coding-standard-dist
最新稳定版本:1.0.11
Composer 安装命令:
composer require webgriffe/hyva-coding-standard-dist
包简介
Hyva Coding Standard distribution for Webgriffe projects
README 文档
README
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.
Installation
Via Composer (recommended)
composer require --dev webgriffe/hyva-coding-standard-dist
Composer 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.
Via artifact ZIP (offline / isolated environments)
Download both ZIPs from the releases page
(this package and webgriffe/magento-coding-standard-dist) and place them in your project's
artifacts/ directory. Then add to your composer.json:
"repositories": [ { "type": "artifact", "url": "./artifacts/" } ]
composer require --dev webgriffe/hyva-coding-standard-dist
Usage
vendor/bin/phpcs --standard=HyvaThemes app/code/path/to/check
List all registered standards (HyvaThemes and Magento2 should appear):
vendor/bin/phpcs -i
Known issue: hardcoded installed_paths in post-install-cmd
If 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" ]
What's included
| Component | Role |
|---|---|
HyvaThemes/ruleset.xml |
HyvaThemes standard (extends Magento2, excludes GraphQL rules) |
squizlabs/php_codesniffer |
vendor/bin/phpcs binary |
dealerdirect/phpcodesniffer-composer-installer |
Automatic phpcs path registration |
webgriffe/magento-coding-standard-dist |
Magento2 standard (conflict-free repack) |
Upstream: hyva-themes/hyva-coding-standard
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2026-06-05