1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @noinspection PhpUndefinedClassInspection |
5
|
|
|
* @noinspection PhpUndefinedNamespaceInspection |
6
|
|
|
* @see https://cs.symfony.com/doc/ruleSets/ |
7
|
|
|
* @see https://cs.symfony.com/doc/rules/ |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
declare(strict_types=1); |
11
|
|
|
|
12
|
|
|
return (new PhpCsFixer\Config()) |
|
|
|
|
13
|
|
|
->setRiskyAllowed(true) |
14
|
|
|
->setCacheFile(__DIR__ . '/build/php-cs-fixer.cache') |
15
|
|
|
->setRules([ |
16
|
|
|
'@PSR12' => true, |
17
|
|
|
// '@PSR12:risky' => true, |
18
|
|
|
// '@PHP71Migration:risky' => true, |
19
|
|
|
'@PHP73Migration' => true, |
20
|
|
|
// symfony |
21
|
|
|
'class_attributes_separation' => true, |
22
|
|
|
'whitespace_after_comma_in_array' => true, |
23
|
|
|
'no_empty_statement' => true, |
24
|
|
|
'no_extra_blank_lines' => true, |
25
|
|
|
'type_declaration_spaces' => true, |
26
|
|
|
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays']], |
27
|
|
|
'no_blank_lines_after_phpdoc' => true, |
28
|
|
|
'object_operator_without_whitespace' => true, |
29
|
|
|
'binary_operator_spaces' => true, |
30
|
|
|
'phpdoc_scalar' => true, |
31
|
|
|
'no_trailing_comma_in_singleline' => true, |
32
|
|
|
'single_quote' => true, |
33
|
|
|
'no_singleline_whitespace_before_semicolons' => true, |
34
|
|
|
'no_unused_imports' => true, |
35
|
|
|
'yoda_style' => ['equal' => true, 'identical' => true, 'less_and_greater' => null], |
36
|
|
|
'standardize_not_equals' => true, |
37
|
|
|
'concat_space' => ['spacing' => 'one'], |
38
|
|
|
'linebreak_after_opening_tag' => true, |
39
|
|
|
'fully_qualified_strict_types' => true, |
40
|
|
|
// symfony:risky |
41
|
|
|
'no_alias_functions' => true, |
42
|
|
|
'self_accessor' => true, |
43
|
|
|
// contrib |
44
|
|
|
'not_operator_with_successor_space' => true, |
45
|
|
|
'ordered_imports' => ['imports_order' => ['class', 'function', 'const']], // @PSR12 sort_algorithm: none |
46
|
|
|
]) |
47
|
|
|
->setFinder( |
48
|
|
|
PhpCsFixer\Finder::create() |
|
|
|
|
49
|
|
|
->in(__DIR__) |
50
|
|
|
->append([__FILE__]) |
51
|
|
|
->exclude(['vendor', 'build']), |
52
|
|
|
) |
53
|
|
|
; |
54
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths