PHPackages                             zhikariz/yii2-fixer - 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. zhikariz/yii2-fixer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zhikariz/yii2-fixer
===================

Yii2 Fixer - Code style fixer for Yii2 projects

v1.1.0(7mo ago)08MITPHPPHP ^8.1

Since Sep 24Pushed 7mo agoCompare

[ Source](https://github.com/zhikariz/yii2-fixer)[ Packagist](https://packagist.org/packages/zhikariz/yii2-fixer)[ RSS](/packages/zhikariz-yii2-fixer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (9)Used By (0)

Yii2 Fixer
==========

[](#yii2-fixer)

Yii2 Fixer is a code style fixer for Yii2 projects. It uses PHP-CS-Fixer under the hood to enforce consistent coding standards.

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

[](#installation)

Install as a development dependency via Composer:

```
composer require --dev zhikariz/yii2-fixer
```

**Note**: This package requires PHP 8.1+. If your project uses an older PHP version, you can still install it by setting the `PHP_CS_FIXER_IGNORE_ENV` environment variable:

```
PHP_CS_FIXER_IGNORE_ENV=1 composer require --dev zhikariz/yii2-fixer
```

However, the tool will only work on PHP 8.1+ systems.

Or clone the repository and run:

```
composer install
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

Fix code style in the current directory:

```
./vendor/bin/yii2-fixer fix
```

Fix a specific file or directory:

```
./vendor/bin/yii2-fixer fix app/models/
./vendor/bin/yii2-fixer fix app/models/User.php
```

### Configuration

[](#configuration)

By default, Yii2 Fixer uses the included `fixer.php` configuration file. You can specify a custom config file (PHP, JSON or YAML) to override rules:

```
./vendor/bin/yii2-fixer fix --config custom-config.json
```

#### Custom Configuration

[](#custom-configuration)

Create a `custom-config.json` file in your project root:

```
{
  "rules": {
    "@PSR12": true,
    "array_syntax": {
      "syntax": "short"
    },
    "indentation_type": true
  },
  "notPath": ["vendor/*", "node_modules/*", "storage/*", "tests/_output/*"]
}
```

Or use YAML format (`custom-config.yaml`):

```
rules:
  "@PSR12": true
  array_syntax:
    syntax: short
  indentation_type: true
notPath:
  - "vendor/*"
  - "node_modules/*"
  - "storage/*"
  - "tests/_output/*"
```

Then run:

```
./vendor/bin/yii2-fixer fix --config custom-config.json
# or
./vendor/bin/yii2-fixer fix --config custom-config.yaml
```

The configuration file should return a `PhpCsFixer\Config` instance.

### Rules

[](#rules)

Yii2 Fixer enforces the following rules:

- PSR-2 coding standard
- Short array syntax
- 4 spaces indentation
- Single quotes for strings
- Proper class attribute separation
- PHPDoc formatting
- And more...

See `fixer.php` for the complete list of rules.

Development
-----------

[](#development)

To run tests:

```
./vendor/bin/phpunit
```

License
-------

[](#license)

MIT License

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance62

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

5

Last Release

231d ago

PHP version history (3 changes)v1.0.0PHP ^7.4|^8.0

v1.0.1PHP ^7.4

v1.0.3PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/2042d17ff7414ca724b5b68f5a58cd8edfb488db286f4b5402552fdcc702d3c8?d=identicon)[zhikariz](/maintainers/zhikariz)

---

Top Contributors

[![zhikariz](https://avatars.githubusercontent.com/u/25949126?v=4)](https://github.com/zhikariz "zhikariz (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zhikariz-yii2-fixer/health.svg)

```
[![Health](https://phpackages.com/badges/zhikariz-yii2-fixer/health.svg)](https://phpackages.com/packages/zhikariz-yii2-fixer)
```

###  Alternatives

[phpro/soap-client

A general purpose SoapClient library

8885.6M46](/packages/phpro-soap-client)[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

4743.5k10](/packages/phel-lang-phel-lang)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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