PHPackages                             friendsofphp/php-cs-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. friendsofphp/php-cs-fixer

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

friendsofphp/php-cs-fixer
=========================

A tool to automatically fix PHP code style

v3.94.2(2mo ago)13.5k234.7M↓15.8%1.6k[44 issues](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues)[36 PRs](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pulls)20MITPHPPHP ^7.4 || ^8.0CI passing

Since Nov 20Pushed today200 watchersCompare

[ Source](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)[ Packagist](https://packagist.org/packages/friendsofphp/php-cs-fixer)[ GitHub Sponsors](https://github.com/keradus)[ RSS](/packages/friendsofphp-php-cs-fixer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (32)Versions (374)Used By (20)

 [ ![PHP CS Fixer logo](./logo.png "PHP CS Fixer") ](https://cs.symfony.com)

PHP Coding Standards Fixer
==========================

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

The PHP Coding Standards Fixer (PHP CS Fixer) fixes your code to follow the standards.

If you are already using a linter to identify coding standards problems in your code, you know that fixing them by hand is tedious, especially on large projects. This tool not only detects them, but also fixes them for you.

PHP CS Fixer has built-in rule sets, whether you want to follow PHP coding standards as defined by [PHP-FIG's PER Coding Style](https://www.php-fig.org/per/coding-style/) - [`@PER-CS`](./doc/ruleSets/PER-CS.rst), a wide community like the [Symfony](https://symfony.com/doc/current/contributing/code/standards.html) - [`@Symfony`](./doc/ruleSets/Symfony.rst), or our opinionated one - [@PhpCsFixer](./doc/ruleSets/PhpCsFixer.rst). You can also define your (team's) style through the [configuration file](./doc/config.rst).

PHP CS Fixer can not only unify the style of your code, but also help to modernise your codebase towards newer PHP (e.g. [`@autoPHPMigration`](./doc/ruleSets/AutoPHPMigration.rst) and [`@autoPHPMigration:risky`](./doc/ruleSets/AutoPHPMigrationRisky.rst)) and newer PHPUnit (e.g. [`@autoPHPUnitMigration:risky`](./doc/ruleSets/AutoPHPUnitMigrationRisky.rst)).

There are also [`@auto`](./doc/ruleSets/Auto.rst) and [`@auto:risky`](./doc/ruleSets/AutoRisky.rst) that aim to provide good base rules.

Supported PHP Versions
----------------------

[](#supported-php-versions)

- PHP 7.4 - PHP 8.5

Note

Each new PHP version requires a huge effort to support the new syntax. That's why the latest PHP version might not be supported yet. If you need it, please consider supporting the project in any convenient way, for example, with code contributions or reviewing existing PRs. To run PHP CS Fixer on yet unsupported versions "at your own risk" - use `--allow-unsupported-php-version=yes` option.

Documentation
-------------

[](#documentation)

### Installation

[](#installation)

The recommended way to install PHP CS Fixer is to use [Composer](https://getcomposer.org/download/):

```
composer require --dev friendsofphp/php-cs-fixer
## or when facing conflicts in dependencies:
composer require --dev php-cs-fixer/shim
```

For more details and other installation methods (also with Docker or behind CI), see [installation instructions](./doc/installation.rst).

### Usage

[](#usage)

Assuming you installed PHP CS Fixer as instructed above, you can initialise base config for your project by using following command:

```
./vendor/bin/php-cs-fixer init
```

To automatically fix your project, or only check against the need of changes, run:

```
./vendor/bin/php-cs-fixer fix
./vendor/bin/php-cs-fixer check
```

See [usage](./doc/usage.rst), list of [built-in rules](./doc/rules/index.rst), list of [rule sets](./doc/ruleSets/index.rst)and [configuration file](./doc/config.rst) documentation for more details.

If you need to apply code styles that are not built-in into the tool, you can [create custom rules](./doc/custom_rules.rst).

Editor Integration
------------------

[](#editor-integration)

Native support exists for:

- [PhpStorm](https://www.jetbrains.com/help/phpstorm/using-php-cs-fixer.html)

Community plugins exist for:

- [NetBeans](https://plugins.netbeans.apache.org/catalogue/?id=36)
- [Sublime Text](https://github.com/benmatselby/sublime-phpcs)
- [Vim](https://github.com/stephpy/vim-php-cs-fixer)
- [VS Code](https://github.com/junstyle/vscode-php-cs-fixer)

Community
---------

[](#community)

The PHP CS Fixer is maintained on GitHub at . Contributions, bug reports and ideas about new features are welcome there.

You can reach us in the [GitHub Discussions](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/) regarding the project, configuration, possible improvements, ideas and questions.

Contribute
----------

[](#contribute)

The tool comes with quite a few built-in fixers, but everyone is more than welcome to [contribute](./CONTRIBUTING.md) more of them.

###  Health Score

87

—

ExcellentBetter than 100% of packages

Maintenance93

Actively maintained with recent releases

Popularity90

Widely adopted with strong download metrics

Community71

Healthy contributor diversity

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 58.1% 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 ~13 days

Recently: every ~7 days

Total

366

Last Release

87d ago

Major Versions

v2.18.6 → v3.0.0-rc.12021-04-19

v2.19.0 → v3.0.02021-05-03

v2.19.1 → v3.0.12021-08-02

v2.19.2 → v3.0.32021-08-29

v2.19.3 → v3.3.02021-11-15

PHP version history (16 changes)v0.1.0PHP &gt;=5.3.3

v0.4.0PHP &gt;=5.3.6

v2.0.0-alphaPHP ^5.3.6 || ^7.0

v1.12.0PHP ^5.3.6 || &gt;=7.0 &lt;7.2

v2.3.0PHP ^5.6 || &gt;=7.0 &lt;7.2

v2.2.8PHP ^5.3.6 || &gt;=7.0 &lt;7.3

v2.6.1PHP ^5.6 || &gt;=7.0 &lt;7.3

v2.14.0PHP ^5.6 || ^7.0

v2.16.7PHP ^7.1

v2.16.6PHP ^7.0

v2.17.0PHP ^5.6 || ^7.0 || ^8.0

v3.0.0-beta.1PHP ^7.1.3 || ^8.0

v3.2.1PHP ^7.2 || ^8.0

v3.3.1PHP ^7.2.5 || ^8.0

v3.5.0PHP ^7.4 || ^8.0

v3.21.1PHP ^8.0.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47313?v=4)[Fabien Potencier](/maintainers/fabpot)[@fabpot](https://github.com/fabpot)

![](https://avatars.githubusercontent.com/u/2716794?v=4)[Dariusz Rumiński](/maintainers/keradus)[@keradus](https://github.com/keradus)

---

Top Contributors

[![keradus](https://avatars.githubusercontent.com/u/2716794?v=4)](https://github.com/keradus "keradus (6021 commits)")[![SpacePossum](https://avatars.githubusercontent.com/u/10462973?v=4)](https://github.com/SpacePossum "SpacePossum (1618 commits)")[![kubawerlos](https://avatars.githubusercontent.com/u/9282069?v=4)](https://github.com/kubawerlos "kubawerlos (1020 commits)")[![fabpot](https://avatars.githubusercontent.com/u/47313?v=4)](https://github.com/fabpot "fabpot (322 commits)")[![julienfalque](https://avatars.githubusercontent.com/u/1736542?v=4)](https://github.com/julienfalque "julienfalque (307 commits)")[![Wirone](https://avatars.githubusercontent.com/u/600668?v=4)](https://github.com/Wirone "Wirone (153 commits)")[![gharlan](https://avatars.githubusercontent.com/u/330436?v=4)](https://github.com/gharlan "gharlan (139 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (107 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (94 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (81 commits)")[![mvorisek](https://avatars.githubusercontent.com/u/2228672?v=4)](https://github.com/mvorisek "mvorisek (78 commits)")[![Slamdunk](https://avatars.githubusercontent.com/u/152236?v=4)](https://github.com/Slamdunk "Slamdunk (73 commits)")[![ntzm](https://avatars.githubusercontent.com/u/3888578?v=4)](https://github.com/ntzm "ntzm (52 commits)")[![paulbalandan](https://avatars.githubusercontent.com/u/51850998?v=4)](https://github.com/paulbalandan "paulbalandan (39 commits)")[![Seldaek](https://avatars.githubusercontent.com/u/183678?v=4)](https://github.com/Seldaek "Seldaek (30 commits)")[![clxmstaab](https://avatars.githubusercontent.com/u/47448731?v=4)](https://github.com/clxmstaab "clxmstaab (26 commits)")[![jrmajor](https://avatars.githubusercontent.com/u/26096713?v=4)](https://github.com/jrmajor "jrmajor (22 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (20 commits)")[![dmvdbrugge](https://avatars.githubusercontent.com/u/14186025?v=4)](https://github.com/dmvdbrugge "dmvdbrugge (18 commits)")[![VincentLanglet](https://avatars.githubusercontent.com/u/9052536?v=4)](https://github.com/VincentLanglet "VincentLanglet (17 commits)")

---

Tags

code-standardscode-stylephpstatic-analysisstandardsstatic analysisfixerStatic code analysis

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/friendsofphp-php-cs-fixer/health.svg)

```
[![Health](https://phpackages.com/badges/friendsofphp-php-cs-fixer/health.svg)](https://phpackages.com/packages/friendsofphp-php-cs-fixer)
```

###  Alternatives

[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.4k187.2M2.6k](/packages/composer-composer)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

134391.5k12](/packages/rector-rector-src)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[phan/phan

A static analyzer for PHP

5.6k11.2M1.1k](/packages/phan-phan)

PHPackages © 2026

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