-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.php-cs-fixer.dist.php
More file actions
38 lines (30 loc) 路 1.07 KB
/
Copy path.php-cs-fixer.dist.php
File metadata and controls
38 lines (30 loc) 路 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
declare(strict_types=1);
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/public',
])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
// Base PSR-12 ruleset
'@PSR12' => true,
// Enforce strict_types on every file
'declare_strict_types' => true,
// Modern array syntax
'array_syntax' => ['syntax' => 'short'],
// Import hygiene
'no_unused_imports' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'single_import_per_statement' => true,
// Trailing commas in multi-line structures
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'arguments', 'parameters']],
// String & concatenation
'no_trailing_whitespace' => true,
'concat_space' => ['spacing' => 'one'],
])
->setFinder($finder);