-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.php-cs-fixer.dist.php
More file actions
119 lines (116 loc) · 4.09 KB
/
.php-cs-fixer.dist.php
File metadata and controls
119 lines (116 loc) · 4.09 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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
$customTokens = [
'T_VOID_CAST',
'T_PIPE',
'T_ATTRIBUTE_COMMENT',
'T_CLOSE_ALT',
'T_NULL',
'T_OPEN_UNENCLOSED',
'T_CLOSE_UNENCLOSED',
'T_LOGICAL_NOT',
'T_DOUBLE_QUOTE',
'T_DOLLAR',
'T_MOD',
'T_AND',
'T_OPEN_PARENTHESIS',
'T_CLOSE_PARENTHESIS',
'T_MUL',
'T_PLUS',
'T_COMMA',
'T_MINUS',
'T_CONCAT',
'T_DIV',
'T_COLON',
'T_SEMICOLON',
'T_SMALLER',
'T_EQUAL',
'T_GREATER',
'T_QUESTION',
'T_AT',
'T_OPEN_BRACKET',
'T_CLOSE_BRACKET',
'T_XOR',
'T_BACKTICK',
'T_OPEN_BRACE',
'T_OR',
'T_CLOSE_BRACE',
'T_NOT',
];
/** @disregard P1009 */
$finder = (new PhpCsFixer\Finder())
->in([
__DIR__ . '/scripts',
__DIR__ . '/src',
__DIR__ . '/tests/integration',
__DIR__ . '/tests/unit',
__DIR__ . '/tools/apigen/src',
])
->append([
__DIR__ . '/bin/pretty-php',
__DIR__ . '/tests/phpstan-conditional.php',
__DIR__ . '/.php-cs-fixer.dist.php',
__DIR__ . '/bootstrap.php',
]);
/** @disregard P1009 */
return (new PhpCsFixer\Config())
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setRules([
'fully_qualified_strict_types' => true,
'is_null' => true,
'native_constant_invocation' => ['include' => $customTokens],
'new_with_parentheses' => ['anonymous_class' => false],
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'no_unneeded_import_alias' => true,
'no_unused_imports' => true,
'nullable_type_declaration_for_default_null_value' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => ['order' => [
'todo',
'see',
'link',
'property',
'property-read',
'property-write',
'method',
'api',
'internal',
'requires',
'dataProvider',
'backupGlobals',
'template',
'template-covariant',
'extends',
'implements',
'use',
'phpstan-require-extends',
'phpstan-require-implements',
'readonly',
'var',
'param',
'param-out',
'return',
'throws',
'codeCoverageIgnore',
]],
// 'phpdoc_param_order' => true,
'phpdoc_separation' => ['groups' => [
['see', 'link'],
['property', 'property-read', 'property-write', 'phpstan-property', 'phpstan-property-read', 'phpstan-property-write'],
['method', 'phpstan-method'],
['requires', 'dataProvider', 'backupGlobals'],
['template', 'template-covariant'],
['extends', 'implements', 'use'],
['phpstan-require-extends', 'phpstan-require-implements'],
['readonly', 'var', 'param', 'param-out', 'return', 'throws', 'phpstan-var', 'phpstan-param', 'phpstan-return', 'phpstan-assert*', 'phpstan-ignore*', 'disregard'],
['phpstan-*'],
['codeCoverageIgnore'],
]],
'phpdoc_tag_casing' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'single_import_per_statement' => true,
'single_trait_insert_per_statement' => true,
'yoda_style' => ['equal' => false, 'identical' => false],
])
->setFinder($finder)
->setRiskyAllowed(true);