A pre-defined set of coding standards for PHP CS Fixer.

Fund package maintenance!

2.2.0 2023-06-02 20:36 UTC


Join our Community Become a Sponsor One-time Donation
Latest Stable Version Total Downloads License GitHub branch checks state

A pre-defined set of coding standards for PHP CS Fixer
Created by Chris Kankiewicz (@PHLAK)


  • PHP >= 7.2


composer require --dev phlak/coding-standards


After installation you may initialze the coding standards configuration with the provided cs executable.

composer exec cs init

Alternatively you may manually create a .php-cs-fxer.dist.php file in the root folder with the following contents.


require __DIR__ . '/vendor/autoload.php';

$finder = PhpCsFixer\Finder::create()->in([
    // List of paths you wish to include

return PHLAK\CodingStandards\ConfigFactory::make($finder);

Add the paths you wish to be coverd to the array.

Now you may run php-cs-fixer as normal.

Add / Override Rules

You can add additional rules or override pre-defined ones by passing them as the second parameter to the ConfigFactory::make() method. These rules will be merged with the pre-defined rules.

return PHLAK\CodingStandards\ConfigFactory::make($finder, [
    // Your additional rules here...

Additional Configuration

Additional configuration can be achieved by chaining methods onto the ConfigFactory::make() method.

return PHLAK\CodingStandards\ConfigFactory::make($finder)


A list of changes can be found on the GitHub Releases page.


For general help and support join our GitHub Discussions or reach out on Twitter.

Please report bugs to the GitHub Issue Tracker.


This project is licensed under the MIT License.