PHPackages                             hyva-themes/hyva-coding-standard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. hyva-themes/hyva-coding-standard

ActivePhpcodesniffer-standard[Testing &amp; Quality](/categories/testing)

hyva-themes/hyva-coding-standard
================================

A set of Hyvä specific PHP CodeSniffer rules extending the Magento Coding Standard

1.0.1(3y ago)2923.5k↑35.4%5[1 issues](https://github.com/hyva-themes/hyva-coding-standard/issues)[1 PRs](https://github.com/hyva-themes/hyva-coding-standard/pulls)BSD-3-ClausePHPPHP &gt;=7.3

Since Jul 7Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/hyva-themes/hyva-coding-standard)[ Packagist](https://packagist.org/packages/hyva-themes/hyva-coding-standard)[ RSS](/packages/hyva-themes-hyva-coding-standard/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Hyva-Themes PHP\_CodeSniffer ruleset
====================================

[](#hyva-themes-php_codesniffer-ruleset)

A set of Hyvä specific PHP CodeSniffer rules extending the Magento Coding Standard.

Installation
------------

[](#installation)

We NOT recommend installing the hyva-coding-standard as a dev dependency of the Magento project, because it shares some dependencies with Magento, which can easily lead to composer version conflicts. Instead, we recommend a stand-alone installation of the hyva-coding-standard.

### Stand-alone installation

[](#stand-alone-installation)

Run the following command to install the coding standard stand-alone in a directory `hyva-coding-standard`. You can do this inside or outside the Magento project folder. If you want to set up PHPStorm inspections and are using a remote PHP interpreter (e.g. warden), you will have to install the coding standard inside the Magento project (see below for details). Otherwise we recommend doing this outside of your Magento project folder so it doesn't interfere with the project structure.

```
composer create-project --no-plugins --no-dev hyva-themes/hyva-coding-standard hyva-coding-standard
```

This is also the recommended approach for checking the coding standard in a CI pipeline.

### Installation as a dev dependency of the project

[](#installation-as-a-dev-dependency-of-the-project)

Installing the hyva-coding-standard as a project dependency is not recommended. Instead, consider installing it as stand-alone as described above. If you still want to go ahead, because you are sure the dependencies shared with Magento have compatible versions, run the following commands:

```
composer require --dev hyva-themes/hyva-coding-standard
./vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibilit,../../hyva-themes/hyva-coding-standard/src
```

Command-Line Usage
------------------

[](#command-line-usage)

Independently of how you installed the hyva-coding-standard, you can check your code by running `vendor/bin/phpcs` within the folder you installed it in.

For example, if you have a stand-alone installation of the hyva-coding-standard inside your home directory within a folder `hyva-coding-standard`, execute

```
~/hyva-coding-standard/vendor/bin/phpcs --standard=HyvaThemes app/code/path/to/check
```

If you installed it as a Magento project dependency, adjust the path to `phpcs` accordingly:

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

Configuration in PHPStorm
-------------------------

[](#configuration-in-phpstorm)

Setting up the PHPStorm configuration differs depending on if you use a containerized or local PHP interpreter. The dialog details also depend on the PHPStorm version. These instructions are based on PHPStorm 2022.1.3.

### PHPStorm setup with a local PHP Interpreter

[](#phpstorm-setup-with-a-local-php-interpreter)

1. In the settings under PHP, ensure a local PHP interpreter is configured.
2. Under "PHP &gt; Quality Tools", select PHP\_CodeSniffer
3. Select the "Local" configuration in the dropdown
4. Click the button with the three dots beside the dropdown
5. Enter the absolute path to `vendor/bin/phpcs` and `vendor/bin/phpcbf` within your stand-alone installation folder, (for example, in my case that is `/Users/vinai/hyva-coding-standard/vendor/bin/phpcs`).
6. Click the "Validate" button, then close the dialog with "OK" if everything is configured correctly.
7. In the PHPStorm settings, navigate to "Editor &gt; Inspections &gt; PHP &gt; Quality Tools"
8. Select "PHP\_CodeSniffer validation"
9. Ensure the file name extension input contains "php,phtml,css"
10. In the "Coding Standard" dropdown, select "Custom"
11. Click the button with the three dots beside the dropdown
12. Enter the absolute path to the HyvaThemes ruleset in your stand-alone installation (for example, in my case that is `/Users/vinai/hyva-coding-standard/src/HyvaThemes`).
13. Click "OK" to apply the path to the coding standard, and click "OK" again to close the settings dialog.

### With PHP in docker (e.g. warden)

[](#with-php-in-docker-eg-warden)

When using a container based PHP dev environment (for example [warden](https://warden.dev/)), PHPStorm is usually configured to run a "remote" PHP interpreter inside the container. In this case the PHPStorm code sniffer integration is only able to work with a coding standard installation *inside* of the project folder structure. This is a limitation of PHPStorm.

This means, you will have to install the `hyva-coding-standard` stand alone inside the Magento base directory. You probably want to configure it as an excluded directory in PHPStorm, so it isn't indexed. For example, in case of warden, the commands to create a stand-alone installation of the coding standard inside of the project director look like this:

```
warden shell
composer create-project --no-plugins --no-dev hyva-themes/hyva-coding-standard hyva-coding-standard
```

Then configure PHPStorm to use the coding standard using the file system paths inside the container:

1. In the settings under PHP, ensure a remote PHP interpreter is configured for the container.
2. Under "PHP &gt; Quality Tools", select PHP\_CodeSniffer
3. Select the correct remote configuration in the dropdown (e.g. "Interpreter: php-fpm" in case or warden).
4. Click the button with the three dots beside the dropdon
5. Enter the absolute path to `vendor/bin/phpcs` and `vendor/bin/phpcbf` within your stand-alone installation folder, (for example, in case of warden that is `/var/www/html/hyva-coding-standard/vendor/bin/phpcs`).
6. Click the "Validate" button, then close the dialog with "OK" if everything is configured correctly.
7. In the PHPStorm settings, navigate to "Editor &gt; Inspections &gt; PHP &gt; Quality Tools"
8. Select "PHP\_CodeSniffer validation"
9. Ensure the file name extension input contains "php,phtml,css"
10. In the "Coding Standard" dropdown, select "Custom"
11. Click the button with the three dots beside the dropdown
12. Enter the absolute path to the HyvaThemes ruleset in your stand-alone installation (for example, in my case that is `/var/www/html/hyva-coding-standard/src/HyvaThemes`).
13. Click "OK" to apply the path to the coding standard, and click "OK" again to close the settings dialog.

### License

[](#license)

This package is licensed under the **Open Software License (OSL 3.0)**.

- **Copyright:** Copyright © 2020-present Hyvä Themes. All rights reserved.
- **License Text (OSL 3.0):** The full text of the OSL 3.0 license can be found in the `LICENSE.txt` file within this package, and is also available online at .

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance57

Moderate activity, may be stable

Popularity39

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~36 days

Total

2

Last Release

1375d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1905417db5fbd31a61553b29bd441fdc66945da7cfb14f1b20a72275c68184e8?d=identicon)[vinai](/maintainers/vinai)

![](https://www.gravatar.com/avatar/7cd0062c670f61aa554c5d30193848ac11031b6cdb8f8616249b95a235eb475d?d=identicon)[wigman](/maintainers/wigman)

---

Top Contributors

[![Vinai](https://avatars.githubusercontent.com/u/72463?v=4)](https://github.com/Vinai "Vinai (5 commits)")[![JeroenBoersma](https://avatars.githubusercontent.com/u/1163348?v=4)](https://github.com/JeroenBoersma "JeroenBoersma (1 commits)")[![rodrigoprimo](https://avatars.githubusercontent.com/u/77215?v=4)](https://github.com/rodrigoprimo "rodrigoprimo (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hyva-themes-hyva-coding-standard/health.svg)

```
[![Health](https://phpackages.com/badges/hyva-themes-hyva-coding-standard/health.svg)](https://phpackages.com/packages/hyva-themes-hyva-coding-standard)
```

###  Alternatives

[slevomat/coding-standard

Slevomat Coding Standard for PHP\_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.

1.5k123.5M1.8k](/packages/slevomat-coding-standard)[magento/magento-coding-standard

A set of Magento specific PHP CodeSniffer rules.

37113.4M299](/packages/magento-magento-coding-standard)[youwe/testing-suite

Contains Youwe's default testing packages for php.

13176.9k8](/packages/youwe-testing-suite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
