PHPackages                             vyants/yii2-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. [Framework](/categories/framework)
4. /
5. vyants/yii2-coding-standards

ActiveLibrary[Framework](/categories/framework)

vyants/yii2-coding-standards
============================

Yii PHP Framework Version 2 - Coding standard tools

2.0.0(11y ago)03.6kBSD-3-ClausePHPPHP &gt;=5.4.0

Since Jul 11Pushed 10y ago1 watchersCompare

[ Source](https://github.com/vyants/yii2-coding-standards)[ Packagist](https://packagist.org/packages/vyants/yii2-coding-standards)[ Docs](http://www.yiiframework.com/)[ RSS](/packages/vyants-yii2-coding-standards/feed)WikiDiscussions master Synced 1mo ago

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

Yii 2 Web Framework Coding Standard
===================================

[](#yii-2-web-framework-coding-standard)

This repository contains settings for [Yii2 coding style](https://github.com/yiisoft/yii2/wiki/Core-framework-code-style)for various tools.

Getting code
------------

[](#getting-code)

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

- Clone `yiisoft/yii2-coding-standards` repository:

```
$ git clone git://github.com/yiisoft/yii2-coding-standards.git

```

- Install `composer.phar` distribution:

```
$ curl -sS https://getcomposer.org/installer | php

```

Or if your system doesn't have CURL installed:

```
$ php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"

```

- Set up all dependencies declared in `composer.json`:

```
$ php composer.phar install

```

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

[](#php_codesniffer)

[PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) coding standard, rule set and sniff token parsing classes for the [Yii 2 Web Framework](https://github.com/yiisoft/yii2/). Overally rules are based on PSR-2 standard with some minor exceptions and changes. Rules derived from PSR-2 standard and excluded in Yii2 standard were implemented (or planned to be) as sniff classes.

Rules could also be used for checking code style of an existing Yii2 applications.

Everything that is merged into main [Yii2 development repository](https://github.com/yiisoft/yii2) being checked with these rule set as well.

### Using code style

[](#using-code-style)

After CodeSniffer is installed you can launch it with custom code style using the following syntax:

```
$ ./vendor/bin/phpcs --extensions=php --standard=Yii2 /home/resurtm/work/Yii2MegaApp/

```

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

### 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)

PhpStorm
--------

[](#phpstorm)

Yii uses PSR-1 and PSR-2 as code style standards. You can choose these via `Settings` → `Code Style` → `PHP` → `Set from...` → `Predefined Style` → `PSR1/PSR2`.

ADDITIONAL NOTES
----------------

[](#additional-notes)

Feel free to request additional features, submit bugs and problems.

Thank you for choosing Yii Framework!

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

2

Last Release

4329d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c688905d1f27d8ef3009ff7429765937fcfa4945d4573658fb021e8f0c411cb1?d=identicon)[vyants](/maintainers/vyants)

---

Top Contributors

[![vyants](https://avatars.githubusercontent.com/u/10527620?v=4)](https://github.com/vyants "vyants (17 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (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)")[![nkovacs](https://avatars.githubusercontent.com/u/2269242?v=4)](https://github.com/nkovacs "nkovacs (2 commits)")[![qiangxue](https://avatars.githubusercontent.com/u/993322?v=4)](https://github.com/qiangxue "qiangxue (1 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)")

---

Tags

frameworkcodesnifferyii

### Embed Badge

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

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

###  Alternatives

[yiisoft/yii2-coding-standards

Yii PHP Framework Version 2 - Coding standard tools

1831.0M165](/packages/yiisoft-yii2-coding-standards)[cakephp/cakephp-codesniffer

CakePHP CodeSniffer Standards

23711.0M658](/packages/cakephp-cakephp-codesniffer)[spryker/code-sniffer

Spryker Code Sniffer Standards

374.1M2.3k](/packages/spryker-code-sniffer)[hprose/hprose-yii

Hprose Server for Yii 2

357.1k](/packages/hprose-hprose-yii)[linnk/allman-codesniffer

Allman CodeSniffer &amp; Linnk Standards

121.8k](/packages/linnk-allman-codesniffer)[yiisoft/cache-apcu

Yii Caching Library - APCu Handler

136.5k](/packages/yiisoft-cache-apcu)

PHPackages © 2026

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