forked from briannesbitt/Carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
112 lines (106 loc) · 3.03 KB
/
.php-cs-fixer.dist.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
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
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$header = <<<'EOF'
This file is part of the Carbon package.
(c) Brian Nesbitt <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;
$rules = [
'@PSR2' => true,
'@PSR12' => true,
'@PHP71Migration' => true,
'array_syntax' => [
'syntax' => 'short',
],
'blank_line_after_namespace' => true,
'blank_line_before_statement' => true,
'cast_spaces' => true,
'class_definition' => false,
'concat_space' => [
'spacing' => 'none',
],
'ereg_to_preg' => true,
'general_phpdoc_tag_rename' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => $header,
'location' => 'after_declare_strict',
'separate' => 'both',
],
'is_null' => true,
'line_ending' => true,
'modernize_types_casting' => true,
'native_function_invocation' => [
'include' => ['@compiler_optimized'],
],
'no_blank_lines_after_phpdoc' => true,
'no_empty_phpdoc' => true,
'no_extra_blank_lines' => true,
'no_short_bool_cast' => true,
'no_unneeded_control_parentheses' => true,
'no_unused_imports' => true,
'no_whitespace_in_blank_line' => true,
'ordered_imports' => true,
'php_unit_method_casing' => [
'case' => 'camel_case',
],
'php_unit_test_annotation' => [
'style' => 'prefix',
],
'php_unit_test_case_static_method_calls' => [
'call_type' => 'this',
],
'phpdoc_align' => [
'align' => 'vertical',
'tags' => [
'param',
'return',
'throws',
'type',
'var',
],
],
'phpdoc_indent' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_no_access' => true,
'phpdoc_no_package' => true,
'phpdoc_order' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_tag_type' => [
'tags' => [
'inheritdoc' => 'inline',
],
],
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
'self_accessor' => true,
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'yoda_style' => [
'always_move_variable' => false,
'equal' => false,
'identical' => false,
'less_and_greater' => false,
],
];
return (new Config())->setRules($rules)
->setFinder(
Finder::create()
->in(__DIR__)
->notPath([
'src/Carbon/Doctrine/DateTimeImmutableType.php',
'src/Carbon/Doctrine/DateTimeType.php',
])
)
->setUsingCache(true)
->setRiskyAllowed(true);