Repository navigation
Expand file tree
/
Copy pathphp-cs-fixer-rules.php
More file actions
76 lines (75 loc) · 2.99 KB
/
Copy pathphp-cs-fixer-rules.php
File metadata and controls
76 lines (75 loc) · 2.99 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
<?php
return [
'@DoctrineAnnotation' => true,
'@PER-CS2x0' => true,
'@PER-CS2x0:risky' => true,
'@PHP8x0Migration' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHPUnit8x4Migration:risky' => true,
'attribute_empty_parentheses' => true, // By PER2.0
'blank_line_before_statement' => [
'statements' => [
'break',
'case',
'continue',
'declare',
'default',
'do',
'exit',
'for',
'foreach',
'goto',
'if',
'include',
'include_once',
'require',
'require_once',
'return',
'switch',
'throw',
'try',
'while',
'yield_from',
],
],
'blank_line_between_import_groups' => false, // Too much noise
'comment_to_phpdoc' => ['ignored_tags' => ['codeCoverageIgnoreStart', 'codeCoverageIgnoreEnd']],
'concat_space' => ['spacing' => 'one'], // Clarity for concatenations
'class_attributes_separation' => [
'elements' => [ // Keep spaces to a minimum
'const' => 'none',
'method' => 'one',
'property' => 'none',
'trait_import' => 'none',
'case' => 'one'
],
],
'declare_strict_types' => true, // Re-add as Symfony removes this rule
'general_phpdoc_annotation_remove' => ['annotations' => ['since', 'package', 'subpackage', 'date']], // Keep author for borrowed code
//'header_comment' => ['header' => $header], // Needs configuring per project
'mb_str_functions' => true,
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline', 'attribute_placement' => 'standalone', 'after_heredoc' => true],
'method_chaining_indentation' => false, // Too fragile for general usage
'multiline_promoted_properties' => true, // By PER2.0
'not_operator_with_successor_space' => true,
'phpdoc_line_span' => ['property' => 'single', 'const' => 'single'],
'phpdoc_param_order' => true,
'phpdoc_tag_casing' => true,
'regular_callable_call' => true,
'ordered_class_elements' => false, // Use the depth-first ordering approach
'ordered_imports' => [
'imports_order' => ['const', 'class', 'function'],
],
'php_unit_internal_class' => true,
'php_unit_method_casing' => ['case' => 'snake_case'], // it_[does]_[something]
'php_unit_strict' => false, // Cannot do this globally
//'php_unit_test_annotation' => ['style' => 'annotation'],
'php_unit_test_class_requires_covers' => false,
'phpdoc_to_comment' => false, // PHPStan needs these
'phpdoc_var_without_name' => false, // PHPStan needs these
'single_line_throw' => false, // Long messages might be used
'strict_comparison' => false, // Cannot do this globally
'types_spaces' => ['space' => 'single'], // Clarity for separate classes
'yoda_style' => ['equal' => false, 'identical' => false], // Yoda style is not used
];