PHPackages                             mito/coding-standards - 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. mito/coding-standards

ActiveLibrary[Testing &amp; Quality](/categories/testing)

mito/coding-standards
=====================

Mito coding standards

3.0.1(3y ago)16.0k2[1 PRs](https://github.com/hellowearemito/php-coding-standards/pulls)BSD-3-ClausePHPPHP &gt;=5.4.0

Since Aug 4Pushed 3y agoCompare

[ Source](https://github.com/hellowearemito/php-coding-standards)[ Packagist](https://packagist.org/packages/mito/coding-standards)[ Docs](https://mito.hu/)[ RSS](/packages/mito-coding-standards/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (24)Used By (0)

Mito PHP Coding Standards
=========================

[](#mito-php-coding-standards)

This repository contains [Mito](https://mito.hu/)'s coding standards for PHP based applications.

[![Code coverage](docs/clover.svg)](docs/clover.svg)

Getting the code
----------------

[](#getting-the-code)

You can get code style definition using one of the following methods.

- Clone `hellowearemito/php-coding-standards` repository:

```
$ git clone git://github.com/hellowearemito/php-coding-standards.git

```

- Install using [composer](https://getcomposer.org/download/):

```
$ composer require mito/coding-standards:"^3.0"

```

PHP\_Codesniffer
----------------

[](#php_codesniffer)

This repository contains five phpcs standards:

- `Application`: for normal class files.
- `Views`: for view files, requires using curly braces for control structures.
- `ViewsAlternate`: for view files, requires using alternate syntax for control structures.
- `ViewsMixed`: for view files, allows both curly braces and alternate syntax.
- `Others`: for other files, such as configuration files and migration classes.

These standards are based on PSR-12, with some additions and improvements.

The `Views` standards disable some rules that cause problems when mixing php with html, and therefore cannot fully check view files and cannot fix all problems in them, so be careful when using phpcbf with view files.

For a full description of the rules, see [docs/rules.md](docs/rules.md).

### Using the standards

[](#using-the-standards)

After CodeSniffer is installed, you can launch it with a custom standard using the following syntax:

```
$ ./vendor/bin/phpcs --extensions=php --standard=vendor/mito/coding-standards/Application .

```

To automatically fix most issues, use phpcbf:

```
$ ./vendor/bin/phpcbf --extensions=php --standard=vendor/mito/coding-standards/Application .

```

**Warning**: always check phpcbf's output and keep backups. If it breaks your code, you get to keep both pieces.

You should also run a syntax check using `php -l` before running phpcbf, because some sniffs assume the code is syntactically valid, and may mangle it if it is not.

If you're using PhpStorm you can configure it to use CodeSniffer using Settings → PHP → Code Sniffer. The standard can be specified at Inspections → PHP → PHP Code Sniffer validation.

Note that this will check all your files with a single standard, but you should use different standards for different types of files. These standards were designed for use with [gulp-phpcs](https://www.npmjs.com/package/gulp-phpcs) and [gulp-phpcbf](https://www.npmjs.com/package/gulp-phpcbf), so instead of using exclusion patterns in the `ruleset.xml`, they rely on the gulp task selecting the appropriate standard for a file.

You can write your own `ruleset.xml` that extends from the `Application` standard and contains appropriate exclusion patterns (check the `Others` and `Views` `ruleset.xml` files for what rules to exclude).

### Useful links

[](#useful-links)

- [Configuration options](http://pear.php.net/manual/en/package.php.php-codesniffer.config-options.php)
- [Manual and guide](http://pear.php.net/manual/en/package.php.php-codesniffer.php)
- [GitHub repository](https://github.com/squizlabs/PHP_CodeSniffer)

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md) for information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~134 days

Recently: every ~534 days

Total

23

Last Release

1351d ago

Major Versions

0.9.0 → 2.0.0-beta12016-05-23

1.0.2 → 2.0.0-beta32016-05-27

2.x-dev → 3.0.02022-09-05

### Community

Maintainers

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

---

Top Contributors

[![nkovacs](https://avatars.githubusercontent.com/u/2269242?v=4)](https://github.com/nkovacs "nkovacs (72 commits)")[![pgsimon-mito](https://avatars.githubusercontent.com/u/214680573?v=4)](https://github.com/pgsimon-mito "pgsimon-mito (39 commits)")[![albertborsos](https://avatars.githubusercontent.com/u/7307145?v=4)](https://github.com/albertborsos "albertborsos (11 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (7 commits)")[![nkovacs2](https://avatars.githubusercontent.com/u/9216060?v=4)](https://github.com/nkovacs2 "nkovacs2 (7 commits)")[![resurtm](https://avatars.githubusercontent.com/u/100198?v=4)](https://github.com/resurtm "resurtm (4 commits)")[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (3 commits)")[![AlexGx](https://avatars.githubusercontent.com/u/1571119?v=4)](https://github.com/AlexGx "AlexGx (2 commits)")[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (1 commits)")[![gsherwood](https://avatars.githubusercontent.com/u/185976?v=4)](https://github.com/gsherwood "gsherwood (1 commits)")[![pgsimon](https://avatars.githubusercontent.com/u/7509935?v=4)](https://github.com/pgsimon "pgsimon (1 commits)")[![qiangxue](https://avatars.githubusercontent.com/u/993322?v=4)](https://github.com/qiangxue "qiangxue (1 commits)")

---

Tags

phpcscodesniffercoding-standards

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mito-coding-standards/health.svg)

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

###  Alternatives

[dealerdirect/phpcodesniffer-composer-installer

PHP\_CodeSniffer Standards Composer Installer Plugin

598161.9M1.9k](/packages/dealerdirect-phpcodesniffer-composer-installer)[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)[sirbrillig/phpcs-variable-analysis

A PHPCS sniff to detect problems with variables.

14548.5M97](/packages/sirbrillig-phpcs-variable-analysis)[consistence/coding-standard

Consistence - Coding Standard - PHP Code Sniffer rules

75833.3k94](/packages/consistence-coding-standard)[moodlehq/moodle-cs

Moodle Coding Sniffer rules

242.8M5](/packages/moodlehq-moodle-cs)[phpmyadmin/coding-standard

phpMyAdmin PHP\_CodeSniffer Coding Standard

201.2M7](/packages/phpmyadmin-coding-standard)

PHPackages © 2026

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