the-ge / phpcsfixer-fixers
Custom PHP CS Fixer rules by The Ge
1.0.7
2026-03-19 06:23 UTC
Requires
- php: ^8.1 || ^8.2 || ^8.3 || ^8.4
- friendsofphp/php-cs-fixer: ^3.94
Requires (Dev)
- erickskrauch/php-cs-fixer-custom-fixers: ^1.3
- kubawerlos/php-cs-fixer-custom-fixers: dev-main
- php-parallel-lint/php-console-highlighter: ^1.0
- php-parallel-lint/php-parallel-lint: ^1.4
- phpcompatibility/php-compatibility: ^10.0.0@dev
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^13.0
- slevomat/coding-standard: ^8.26
- squizlabs/php_codesniffer: ^4.0
README
Custom PHP CS Fixer fixers.
Installation
composer require --dev the-ge/phpcsfixer-fixers
Fixers
TheGe/blank_lines_before_classy_block
Ensures every named classy declaration (class, interface, trait, enum) — including its modifiers (abstract, final, readonly) and its metadata (comments, docblock, attributes) — is preceded by exactly two blank lines (three newline characters).
Anonymous classes (new class) are excluded.
Priority: -24 (runs after blank_line_after_namespace, no_blank_lines_after_phpdoc, and
single_line_after_imports).
Example
Configuration: ['blank_lines_count' => 2]
// Before namespace N; class Foo {} // After namespace N; class Foo {}
Registration
// .php-cs-fixer.dist.php use TheGe\PhpCsFixer\Fixer\ClassNotation\BlankLinesBeforeClassyBlockFixer; return (new PhpCsFixer\Config()) ->registerCustomFixers([new BlankLinesBeforeClassyBlockFixer()]) ->setRules([ 'TheGe/blank_lines_before_classy_block' => true, ]);
Requirements
- PHP 8.1 – 8.4
- friendsofphp/php-cs-fixer ^3.94
Running Tests
composer boot
composer test