noldors / phpcsfixer-rules
Shared PHP-CS-Fixer preset and multiline layout rules.
Requires
- php: >=8.5
- ext-mbstring: *
- friendsofphp/php-cs-fixer: ^3.95.25
- nikic/php-parser: ^5.9
Requires (Dev)
- denzyl/phanalist: ^1.1
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^13.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-master
- v1.3.0
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.0.1
- dev-feature/validator-method-order
- dev-fix/preserve-concatenated-string-bytes
- dev-fix/skip-cleared-reindent-tokens
- dev-fix/compact-single-array-argument
- dev-fix/pipe-closing-line-layout
- dev-fix/compact-call-layout
- dev-fix/expression-layout
- dev-fix/array-argument-layout
- dev-fix/closure-argument-layout
- dev-chore/require-pr-auto-merge
- dev-chore/packagist-webhook-publication
- dev-fix/public-fixer-registration
- dev-feat/multiline-layout
This package is auto-updated.
Last update: 2026-10-29 19:19:58 UTC
README
One reusable PHP-CS-Fixer configuration containing the complete captured Pint profile: all 270 native rule entries, four layout rules and a function-to-pipe rule, for 275 entries in total. Anonymous function bodies use multiple lines. Custom wrapping defaults to 120 columns, at most three inline method arguments and a separate 40-character limit for a single argument. These are wrapping thresholds, not a universal hard line limit.
Requires PHP >=8.5, ext-mbstring and PHP-CS-Fixer ^3.95.25 (>=3.95.25, <4.0).
Installation
composer require --dev noldors/phpcsfixer-rules
Connection
Create or update the project's .php-cs-fixer.dist.php:
<?php return Noldors\PhpCsFixer\Config::create(__DIR__);
The factory registers the five custom fixers through the supported custom-fixer
API, enables the complete preset and allows its risky native rules, matching
Pint's configuration. Native indentation or spacing changes can require another
formatting run before the dry-run check passes. Its finder scans PHP files under
the supplied project root
and excludes vendor, node_modules, build, storage and bootstrap/cache
directories, Blade templates and standard generated PHP IDE helper files.
The returned Config extends the native PHP-CS-Fixer configuration, supporting
its finder and option methods. Use Config::rules() as the base for deliberate
rule overrides through setRules().
See the migration guide for examples, preset provenance and version support.
vendor/bin/php-cs-fixer fix vendor/bin/php-cs-fixer fix --dry-run --diff
Rule documentation
- Fluent chain wrapping
- Method call wrapping
- Array wrapping
- Conditional expression wrapping
- Function composition to pipe
- String literal safety
- Validator method order
- Migrating a project from Pint
Long arrays used directly as a foreach iterable still require a meaningful
local variable chosen during code review; the formatters do not extract one.