-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy path.php-cs-fixer.php
More file actions
30 lines (27 loc) · 1.42 KB
/
.php-cs-fixer.php
File metadata and controls
30 lines (27 loc) · 1.42 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
<?php
use PhpCsFixer\Finder as PhpCsFixerFinder;
use PhpCsFixer\Config as PhpCsFixerConfig;
$finder = PhpCsFixerFinder::create()
->in(__DIR__)
->exclude('vendor')
->exclude('vendor-bin')
;
$config = new PhpCsFixerConfig();
return $config
->setRules([
'@PER-CS' => true,
'binary_operator_spaces' => ['default' => 'at_least_single_space', 'operators' => ['=>' => 'align']],
'declare_strict_types' => true,
'no_alias_functions' => true,
'no_unused_imports' => true,
'no_useless_sprintf' => true,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'operator_linebreak' => ['only_booleans' => true],
'phpdoc_align' => ['align' => 'vertical'],
'phpdoc_separation' => ['skip_unlisted_annotations' => true],
'self_accessor' => true,
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays']], // remove this line when we drop support for PHP < 8.0
])
->setFinder($finder)
;