-
Notifications
You must be signed in to change notification settings - Fork 5
/
.php-cs-fixer.php
83 lines (74 loc) · 2.67 KB
/
.php-cs-fixer.php
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$header = <<<EOF
(c) shopware AG <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;
$finder = Finder::create()
->filter(function(SplFileInfo $file) {
$blacklistedFiles = [
'acl-config.php',
'test_constants.php'
];
return !in_array($file->getFilename(), $blacklistedFiles, true);
})
->in(__DIR__ . '/CacheMultiplexer')
->in(__DIR__ . '/Caching')
->in(__DIR__ . '/Common')
->in(__DIR__ . '/PrimaryReplica')
->in(__DIR__ . '/Redis')
->in(__DIR__ . '/tests')
;
return (new Config())
->setRules([
'@PSR12' => true,
'@Symfony' => true,
'single_blank_line_before_namespace' => true,
'function_typehint_space' => true,
'declare_strict_types' => true,
'function_declaration' => true,
'no_empty_phpdoc' => true,
'no_empty_comment' => true,
'no_useless_return' => true,
'ordered_imports' => true,
'phpdoc_add_missing_param_annotation' => true,
'header_comment' => ['header' => $header, 'separate' => 'bottom', 'comment_type' => 'PHPDoc'],
'concat_space' => ['spacing' => 'one'],
'phpdoc_no_empty_return' => true,
'phpdoc_order' => true,
'phpdoc_types' => true,
'phpdoc_scalar' => true,
'phpdoc_no_package' => true,
'phpdoc_summary' => false,
'phpdoc_line_span' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'single_quote' => true,
'return_type_declaration' => true,
'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']],
'no_blank_lines_after_class_opening' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_trim' => true,
'blank_line_before_statement' => true,
'whitespace_after_comma_in_array' => true,
'is_null' => true,
'no_spaces_after_function_name' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_blank_lines_after_phpdoc' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'cast_spaces' => true,
'class_definition' => [
'single_line' => true,
],
'self_accessor' => false,
'php_unit_construct' => true,
'php_unit_test_case_static_method_calls' => [
'call_type' => 'static',
],
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
])
->setRiskyAllowed(true)
->setFinder($finder);