Created
August 13, 2025 11:42
-
-
Save jrmessias/baafbd2dbd31b6797d3c2aacbcbac2ba to your computer and use it in GitHub Desktop.
PHP CS Fixer Configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $finder = PhpCsFixer\Finder::create() | |
| ->exclude('vendor') | |
| ->in(__DIR__); | |
| $config = new PhpCsFixer\Config(); | |
| return $config | |
| ->setRules([ | |
| '@PSR12' => true, // Use PSR-12 coding standards | |
| 'array_syntax' => [ | |
| 'syntax' => 'short' // Enforce short array syntax | |
| ], | |
| 'binary_operator_spaces' => [ | |
| 'default' => 'single_space' // Ensure consistent spacing around operators | |
| ], | |
| 'blank_line_before_statement' => [ | |
| 'statements' => [ | |
| 'return', | |
| 'throw', | |
| 'try' | |
| ] | |
| ], | |
| 'method_chaining_indentation' => true, | |
| 'no_unused_imports' => true, | |
| 'ordered_imports' => [ | |
| 'sort_algorithm' => 'alpha', | |
| 'imports_order' => ['class', 'function', 'const'] | |
| ] | |
| ]) | |
| ->setFinder($finder) | |
| ->setUsingCache(true) | |
| ->setRiskyAllowed(true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment