webproject-xyz / php-cs-fixer-config
The WebProject php-cs-fixer-config
Package info
github.com/WebProject-xyz/php-cs-fixer-config
pkg:composer/webproject-xyz/php-cs-fixer-config
1.0.0
2026-07-17 20:59 UTC
Requires
- php: ~8.3.0 || 8.4.0 || ~8.5.0
- friendsofphp/php-cs-fixer: ^3.95.15
Requires (Dev)
- codeception/codeception: ^5.3.5
- codeception/module-asserts: ^3.3.0
- phpro/grumphp: ^2.22.0
- phpstan/phpstan: ^2.2.5
- roave/security-advisories: dev-latest
README
Common PHP CS Fixer configuration for WebProject projects.
Provides a standardized, robust, and modern PHP CS Fixer configuration.
๐ Key Features
- Preconfigured Rules: Includes standard rule sets like
@PSR12,@Symfony,@Symfony:risky,@PhpCsFixer:risky, and@PHP8x3Migration. - Parallel Execution: Automatically detects and utilizes multiple CPU cores for faster analysis.
- Risky Rules Enabled: Risky refactorings are allowed by default.
๐ฆ Installation
Install the package via Composer:
composer require --dev webproject-xyz/php-cs-fixer-config
Prerequisites
- PHP:
~8.5.0
๐ ๏ธ Usage
Create a .php-cs-fixer.php file in the root of your project:
<?php declare(strict_types=1); return new \WebProject\PhpCsFixerConfig\PhpCsFixerConfigFactory()(__DIR__);
Customizing Directories and Exclusions
You can pass specific directories to check, as well as directories to exclude:
<?php declare(strict_types=1); return new \WebProject\PhpCsFixerConfig\PhpCsFixerConfigFactory()( dirs: [ __DIR__ . '/src', __DIR__ . '/tests', ], excludeDirs: [ __DIR__ . '/tests/_output', ] );
๐งช Development & Testing
We maintain high standards for this module:
- Static Analysis: PHPStan Level 8.
- Coding Style: Strict PSR-12/Symfony standards.
- Automation: GrumPHP hooks ensure all commits are verified.
Commands
composer qa # Run all Quality Assurance checks (build tests, fix CS, run tests, run phpstan) composer stan # Run static analysis composer test # Run unit tests composer cs:check # Check coding standards composer cs:fix # Fix coding standards automatically
๐ค Contributing
Contributions are welcome! Please see our CONTRIBUTING.md for details.
- Fork the Project.
- Create your Feature Branch (
git checkout -b feature/AmazingFeature). - Commit your Changes (
git commit -m 'feat: Add some AmazingFeature'). - Push to the Branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
๐ License
Distributed under the MIT License. See LICENSE for more information.
โ๏ธ Support & Contact
- Issues: Please use the GitHub Issue Tracker.
- Website: webproject.xyz