PHPackages                             leviy/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. leviy/coding-standard

ActivePhpcodesniffer-standard[Utility &amp; Helpers](/categories/utility)

leviy/coding-standard
=====================

LEVIY Coding Standard

v4.0.6(3y ago)075.6k↓29.4%1proprietaryPHPPHP ^7.2||^8.0

Since Sep 9Pushed 1y ago5 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (26)Used By (1)

[![Leviy logo](docs/logo.svg)](docs/logo.svg)

Leviy Coding Standard
=====================

[](#leviy-coding-standard)

[![Build status](https://camo.githubusercontent.com/3b16892f5da1d677a854d631042efbe957f199877946c6480902f183d7d615a4/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c657669792f7068702d636f64696e672d7374616e646172642e737667)](https://travis-ci.org/leviy/php-coding-standard)[![Packagist version](https://camo.githubusercontent.com/7a4de5d279e8e56408dd908dd0fc0bef0e7d1b8bb5a1b4d47aa98876277fa7b6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c657669792f636f64696e672d7374616e646172642e737667)](https://packagist.org/packages/leviy/coding-standard)[![PHP from Packagist](https://camo.githubusercontent.com/8c6dcaaaafe049da05c87bd8cd5f79be7bdb4b4e8be21c5132fd3a1171d8f473/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c657669792f636f64696e672d7374616e646172642e737667)](https://github.com/leviy/php-coding-standard/blob/master/composer.json)

The Leviy coding standard for PHP code, with rulesets for [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) and [PHP Mess Detector](https://phpmd.org/).

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

[](#installation)

Install this package using [Composer](https://getcomposer.org/):

```
composer require --dev leviy/coding-standard
```

### Installing the PHP CodeSniffer ruleset

[](#installing-the-php-codesniffer-ruleset)

Create a file `phpcs.xml` in the root of the project with the following contents:

```

    src/
    tests/
    public/index.php

```

### Installing the PHP Mess Detector ruleset

[](#installing-the-php-mess-detector-ruleset)

Create a file `phpmd.xml` in the root of the project with the following contents:

```

    Ruleset for PHP Mess Detector that enforces coding standards

```

Configuration
-------------

[](#configuration)

### PHP CodeSniffer

[](#php-codesniffer)

An annotated `ruleset.xml` configuration file can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml)where you can see the complete range of features and configuration options that can be used to modify the configuration to your project needs.

### PHP Mess Detector

[](#php-mess-detector)

Documentation about tweaking the ruleset and exluding rules or changing settings can be found [here](https://phpmd.org/documentation/creating-a-ruleset.html).

Usage
-----

[](#usage)

Run `vendor/bin/phpcs` to run PHP CodeSniffer. If you have a file `phpcs.xml` or `phpcs.xml.dist` in root directory of the project, CodeSniffer will use it automatically. Add a path to run CodeSniffer only against that file or directory. See [Usage](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage) for more detailed usage instructions.

Run `vendor/bin/phpmd src/ text phpmd.xml` to run PHP Mess Detector against the `src` directory and print a report in the "text" format.

PHPStorm code sniffer validation
--------------------------------

[](#phpstorm-code-sniffer-validation)

1. Open "Preferences" and navigate to "Editor &gt; Inspections".
2. Enable "PHP &gt; Quality tools &gt; PHP\_Code Sniffer validation".
3. Select a "Custom" coding standard.
4. Select the path to the projects code sniffer configuration.

[![](docs/preferences-dialog.png)](docs/preferences-dialog.png)

**Enjoy the immediate feedback of code sniffer validation issues!**

[![](docs/code-sniffer-validation-hint.png)](docs/code-sniffer-validation-hint.png)

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 72.9% 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 ~82 days

Recently: every ~167 days

Total

25

Last Release

1195d ago

Major Versions

1.0.1 → 2.0.02017-10-03

2.0.0 → 3.0.02018-01-10

v3.5.3 → v4.0.02020-02-07

PHP version history (4 changes)1.0.0PHP &gt;=5.6

3.1.0PHP ^7.1

v4.0.1PHP ^7.2

v4.0.5PHP ^7.2||^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/35339329?v=4)[Leviy](/maintainers/leviy)[@leviy](https://github.com/leviy)

![](https://avatars.githubusercontent.com/u/41617?v=4)[Dennis Coorn](/maintainers/denniscoorn)[@denniscoorn](https://github.com/denniscoorn)

![](https://avatars.githubusercontent.com/u/888361?v=4)[Bas Matthee](/maintainers/BasMatthee)[@BasMatthee](https://github.com/BasMatthee)

---

Top Contributors

[![nicwortel](https://avatars.githubusercontent.com/u/1055691?v=4)](https://github.com/nicwortel "nicwortel (62 commits)")[![christiaan](https://avatars.githubusercontent.com/u/118490?v=4)](https://github.com/christiaan "christiaan (11 commits)")[![denniscoorn](https://avatars.githubusercontent.com/u/41617?v=4)](https://github.com/denniscoorn "denniscoorn (3 commits)")[![tlsvda](https://avatars.githubusercontent.com/u/32871631?v=4)](https://github.com/tlsvda "tlsvda (3 commits)")[![VSlokker](https://avatars.githubusercontent.com/u/36398947?v=4)](https://github.com/VSlokker "VSlokker (2 commits)")[![BasMatthee](https://avatars.githubusercontent.com/u/888361?v=4)](https://github.com/BasMatthee "BasMatthee (2 commits)")[![kayjoosten](https://avatars.githubusercontent.com/u/47044428?v=4)](https://github.com/kayjoosten "kayjoosten (1 commits)")[![rodicodi](https://avatars.githubusercontent.com/u/34191525?v=4)](https://github.com/rodicodi "rodicodi (1 commits)")

---

Tags

coding-standardsphpphp-codesnifferphpcs-standardphpmdpsr-2

### Embed Badge

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

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

###  Alternatives

[drupal/coder

Coder is a library to review Drupal code.

3043.6M461](/packages/drupal-coder)[mayflower/mo4-coding-standard

PHP CodeSniffer ruleset implementing the MO4 coding standards extending the Symfony coding standards.

17508.3k5](/packages/mayflower-mo4-coding-standard)

PHPackages © 2026

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