-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp-cs-fixer.php
More file actions
24 lines (23 loc) · 979 Bytes
/
php-cs-fixer.php
File metadata and controls
24 lines (23 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true, // Use PSR-12 coding standard
'array_syntax' => ['syntax' => 'short'], // Use short array syntax
'no_unused_imports' => true, // Remove unused imports
'binary_operator_spaces' => [ // Fix spacing around operators
'operators' => [
'.' => 'single_space', // Fix spacing around concatenation (.)
'=>' => 'single_space', // Fix spacing around array arrows (=>)
],
],
'no_whitespace_in_blank_line' => true, // Remove trailing whitespace
'no_trailing_whitespace' => true, // Remove trailing whitespace
'braces' => [ // Fix braces placement
'allow_single_line_closure' => true,
],
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__) // Apply to the current directory
->exclude('vendor') // Exclude the vendor directory
);