eliashaeussler/php-cs-fixer-config

My personal configuration for PHP-CS-Fixer

Package info

github.com/eliashaeussler/php-cs-fixer-config

pkg:composer/eliashaeussler/php-cs-fixer-config

Statistics

Installs: 731 685

Dependents: 31

Suggesters: 0

Stars: 2

Open Issues: 1

3.1.0 2025-12-19 17:38 UTC

Requires

Suggests

  • typo3/coding-standards: Shipped PHP-CS-Fixer rules for TYPO3 projects and extensions can be included automatically

Provides

None

Conflicts

None

Replaces

None

GPL-3.0-or-later 320fcdb823a626da59d20e6591006296e97b8bf2

This package is auto-updated.

Last update: 2026-06-18 05:03:32 UTC


README

PHP-CS-Fixer config

πŸ‘ Coverage
πŸ‘ CGL
πŸ‘ Tests
πŸ‘ Supported PHP Versions

This package contains basic PHP-CS-Fixer config for use in my personal projects. It is not meant to be used anywhere else. I won't provide support and don't accept pull requests for this repo.

πŸ”₯ Installation

πŸ‘ Packagist
πŸ‘ Packagist Downloads

composer require eliashaeussler/php-cs-fixer-config

⚑ Usage

Configure PHP-CS-Fixer in your .php-cs-fixer.php file:

use EliasHaeussler\PhpCsFixerConfig;
use Symfony\Component\Finder;

// Create header rule
$header = PhpCsFixerConfig\Rules\Header::create(
 'eliashaeussler/package-name',
 PhpCsFixerConfig\Package\Type::ComposerPackage,
 PhpCsFixerConfig\Package\Author::create('Elias HÀußler', 'elias@haeussler.dev'),
 PhpCsFixerConfig\Package\CopyrightRange::from(2021),
 PhpCsFixerConfig\Package\License::GPL3OrLater,
);

// Create TYPO3 rule set
$typo3RuleSet = PhpCsFixerConfig\Rules\Set\TYPO3RuleSet::create();

// Create custom rule set
$customRuleSet = PhpCsFixerConfig\Rules\RuleSet::fromArray([
 'modernize_types_casting' => true,
 'php_unit_test_case_static_method_calls' => [
 'call_type' => 'self',
 ],
]);

return PhpCsFixerConfig\Config::create()
 ->withRule($header)
 ->withRule($typo3RuleSet)
 ->withRule($customRuleSet)
 // You can also overwrite all rules
 ->withRule($customRuleSet, false)
 ->withFinder(static fn (Finder\Finder $finder) => $finder->in(__DIR__))
 // You can also inject your own Finder instance
 ->withFinder($finder)
;

⭐ License

This project is licensed under GNU General Public License 3.0 (or later).