Common PHP CS Fixer configuration for WebProject projects.
Provides a standardized, robust, and modern PHP CS Fixer configuration.
- 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.
Install the package via Composer:
composer require --dev webproject-xyz/php-cs-fixer-config- PHP:
~8.5.0
Create a .php-cs-fixer.php file in the root of your project:
<?php
declare(strict_types=1);
return new \WebProject\PhpCsFixerConfig\PhpCsFixerConfigFactory()(__DIR__);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',
]
);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.
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 automaticallyContributions 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.
Distributed under the MIT License. See LICENSE for more information.
- Issues: Please use the GitHub Issue Tracker.
- Website: webproject.xyz