PHPackages                             yiisoft/code-style - 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. yiisoft/code-style

ActiveLibrary[Framework](/categories/framework)

yiisoft/code-style
==================

PHP CS Fixer rule sets for Yii packages

1.0.0(3mo ago)38.0k↑562.5%12BSD-3-ClausePHPPHP ^7.4 || ^8.0CI passing

Since Jan 23Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/yiisoft/code-style)[ Packagist](https://packagist.org/packages/yiisoft/code-style)[ Docs](https://www.yiiframework.com/)[ GitHub Sponsors](https://github.com/sponsors/yiisoft)[ OpenCollective](https://opencollective.com/yiisoft)[ RSS](/packages/yiisoft-code-style/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (12)

 [ ![Yii](https://camo.githubusercontent.com/8317c17418b39410a660f5149071d26c5023c0d5fb2b7ebb771324812f666d73/68747470733a2f2f796969736f66742e6769746875622e696f2f646f63732f696d616765732f7969695f6c6f676f2e737667) ](https://github.com/yiisoft)

Yii Code Style
==============

[](#yii-code-style)

[![Latest Stable Version](https://camo.githubusercontent.com/902024229bdfdf0be2582816efd0df82ed535792d5f32e52e15c29bce15ef260/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f636f64652d7374796c652f76)](https://packagist.org/packages/yiisoft/code-style)[![Total Downloads](https://camo.githubusercontent.com/d4901187bf31936b6b4425c69290ae1f700f47a955a1f6f9d8d90baabf9714d8/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f636f64652d7374796c652f646f776e6c6f616473)](https://packagist.org/packages/yiisoft/code-style)[![Build status](https://github.com/yiisoft/code-style/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/yiisoft/code-style/actions/workflows/build.yml?query=branch%3Amaster)[![Code Coverage](https://camo.githubusercontent.com/bb8f5e3b92785be6bc6b628d44f1eb4514b484686dd11a5f24aa5fd10716fffb/68747470733a2f2f636f6465636f762e696f2f67682f796969736f66742f636f64652d7374796c652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/yiisoft/code-style)[![Static analysis](https://github.com/yiisoft/code-style/actions/workflows/static.yml/badge.svg?branch=master)](https://github.com/yiisoft/code-style/actions/workflows/static.yml?query=branch%3Amaster)[![type-coverage](https://camo.githubusercontent.com/f86b5956524b4000e84a61d2d2d5bde61083c36999499b97dfb3cd46e884ef6a/68747470733a2f2f73686570686572642e6465762f6769746875622f796969736f66742f636f64652d7374796c652f636f7665726167652e737667)](https://shepherd.dev/github/yiisoft/code-style)[![psalm-level](https://camo.githubusercontent.com/13086f1ef5d327c207e49c63cd96cdefe51d1ce56451100e1b59ef144e3aab3b/68747470733a2f2f73686570686572642e6465762f6769746875622f796969736f66742f636f64652d7374796c652f6c6576656c2e737667)](https://shepherd.dev/github/yiisoft/code-style)

A package that provides [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) rule sets for enforcing code style in Yii packages.

Requirements
------------

[](#requirements)

- PHP 7.4 or higher.

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

[](#installation)

The package could be installed with [Composer](https://getcomposer.org):

```
composer require --dev yiisoft/code-style
```

General usage
-------------

[](#general-usage)

The package contains the following sets of rules:

1. `@Yiisoft/Core`
2. `@Yiisoft/Core:risky`

An example configuration using these rule sets:

```
