webgriffe/hyva-coding-standard-dist

Hyva Coding Standard distribution for Webgriffe projects

Maintainers

Package info

github.com/webgriffe/hyva-coding-standard-dist

Type:phpcodesniffer-standard

pkg:composer/webgriffe/hyva-coding-standard-dist

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.11 2026-06-09 14:35 UTC

This package is auto-updated.

Last update: 2026-06-09 15:35:07 UTC


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

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.

Usage

vendor/bin/phpcs --standard=HyvaThemes app/code/path/to/check

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"
]