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

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

romanzipp/php-cs-fixer-config
=============================

Personal PHP-CS-Fixer Configuration

3.3.4(1y ago)542.5k↑56.1%120MITPHPPHP ^7.4|^8.0

Since Jan 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/romanzipp/PHP-CS-Fixer-Config)[ Packagist](https://packagist.org/packages/romanzipp/php-cs-fixer-config)[ GitHub Sponsors](https://github.com/romanzipp)[ RSS](/packages/romanzipp-php-cs-fixer-config/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (2)Versions (24)Used By (20)

PHP-CS-Fixer Configuration
==========================

[](#php-cs-fixer-configuration)

[![Latest Stable Version](https://camo.githubusercontent.com/3ca8d4ed0132ed56d36413cab50ec723f127efb029eaa5cde2a33d6fcc32f59e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f6d616e7a6970702f5048502d43532d46697865722d436f6e6669672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/romanzipp/php-cs-fixer-config)[![Total Downloads](https://camo.githubusercontent.com/8dc9e41677d9c2c298c26b8afa2a0775d9558fd7758bd03d165195df2f54363b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f6d616e7a6970702f5048502d43532d46697865722d436f6e6669672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/romanzipp/php-cs-fixer-config)[![License](https://camo.githubusercontent.com/0f07462327b66f9b2314067f5a4ed60ec769eb71124966850a69d9fb05df44bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726f6d616e7a6970702f5048502d43532d46697865722d436f6e6669672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/romanzipp/php-cs-fixer-config)[![GitHub Build Status](https://camo.githubusercontent.com/da212f497735fa7a0e811c4343ebbdf205f115a6da647e27109c22a1bfa82d91/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726f6d616e7a6970702f5048502d43532d46697865722d436f6e6669672f74657374732e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/romanzipp/PHP-CS-Fixer-Config/actions)

Personal [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) wrapper, preset management and custom rules.

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

[](#installation)

```
composer require romanzipp/php-cs-fixer-config --dev

```

**Notice**: You also need to [install the PHP-CS-Fixer package](https://github.com/FriendsOfPHP/PHP-CS-Fixer#installation) itself if you need a local installation with executable in your `vendor/bin` folder.

Usage
-----

[](#usage)

This package has been created to streamline configuration management for multiple projects and keeping PHP CS Fixer rules up to date.

#### `.php-cs-fixer.dist.php`

[](#php-cs-fixerdistphp)

```
return romanzipp\Fixer\Config::make()
    ->in(__DIR__)
    ->preset(
        new romanzipp\Fixer\Presets\PrettyPHP()
    )
    ->out();
```

Available Presets
-----------------

[](#available-presets)

- [**PrettyPHP**](src/Presets/PrettyPHP.php)
- [**PrettyLaravel**](src/Presets/PrettyLaravel.php) (extends [PrettyPHP](src/Presets/PrettyPHP.php))

You can easily create your own presets by extending the [**AbstractPreset**](src/Presets/AbstractPreset.php) class.

### Overriding presets

[](#overriding-presets)

In case you only need some tweaks for specific projects - which won't deserve an own preset - there are various methods you can make us of.

```
$config = romanzipp\Fixer\Config::make();

$config->allowRisky(true);                  // Allow risky rules.
$config->withRules(['...']);                // Set additional rules
$config->exclude(['...']);                  // Add single or many files to the list of excluded files.
$config->excludeDirectories(['...']);       // Add single or many directories to the list of excluded directories.
```

Available Rules
---------------

[](#available-rules)

### Convert PHPDoc Classes to FQCN

[](#convert-phpdoc-classes-to-fqcn)

```
$fixer->withRules([
    'RomanZipp/phpdoc_fqcn' => true,
]);
```

Show code sample#### Bad

[](#bad)

```
use App\Foo;
use App\Bar;

/**
 * @param  Foo $foo
 * @return Bar[]
 */
function foo(Foo $foo): array {}
```

#### Good

[](#good)

```
use App\Foo;

/**
 * @param  \App\Foo $foo
 * @return \App\Bar[]
 */
function foo(Foo $foo): array {}
```

Advanced Usage
--------------

[](#advanced-usage)

### Access the config and finder instances

[](#access-the-config-and-finder-instances)

```
return romanzipp\Fixer\Config::make()
    // ...
    ->finderCallback(static function (PhpCsFixer\Finder $finder): void {
        // ...
    })
    ->configCallback(static function (PhpCsFixer\Config $config): void {
        $config->registerCustomFixers();
        // ...
    })
    // ...
    ->out();
```

PHPStorm Configuration
----------------------

[](#phpstorm-configuration)

### Prequisites

[](#prequisites)

You will need to install PHP CS Fixer globally on your system because PHPStorm [does not allow](https://youtrack.jetbrains.com/issue/WI-56557) you to set the php-cs-fixer executable on a per-project basis or relative to the project path.

```
composer global require friendsofphp/php-cs-fixer
```

### 1. Enable Inspection

[](#1-enable-inspection)

[![](images/inspection.png)](images/inspection.png)

### 2. Select ruleset .php-cs-fixer.dist.php file `[...]`

[](#2-select-ruleset-php-cs-fixerdistphp-file-)

[![](images/ruleset.png)](images/ruleset.png)

Unfortunately you have to repeat this process for every project since [there is a bug in PHPStorm](https://youtrack.jetbrains.com/issue/WI-56557) which prevents users from using relative paths for the `.php-cs-fixer.dist.php` configuration or executable file.

Another theoretical approach to this issue is to create a unified ruleset file in your users .composer folder. This has the downside on only having one single ruleset.

### 3. Navigate to Quality Tools by clicking on the "PHP CS Fixer" link

[](#3-navigate-to-quality-tools-by-clicking-on-the-php-cs-fixer-link)

[![](images/navigate.png)](images/navigate.png)

### 4. Select PHP-CS-Fixer executable

[](#4-select-php-cs-fixer-executable)

[![](images/executable.png)](images/executable.png)

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Recently: every ~14 days

Total

23

Last Release

639d ago

Major Versions

1.0.11 → 3.0.02021-08-06

PHP version history (2 changes)1.0.0PHP ^7.1|^8.0

3.1.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11266773?v=4)[Roman Zipp](/maintainers/romanzipp)[@romanzipp](https://github.com/romanzipp)

---

Top Contributors

[![romanzipp](https://avatars.githubusercontent.com/u/11266773?v=4)](https://github.com/romanzipp "romanzipp (62 commits)")

---

Tags

phpphp-cs-fixerphp7php8phpstormstylingsyntax

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

PHPackages © 2026

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