Skip to content

Commit 08182d5

Browse files
committed
Use centralized style rules
1 parent b6a302f commit 08182d5

File tree

2 files changed

+3
-123
lines changed

2 files changed

+3
-123
lines changed

.php_cs

Lines changed: 1 addition & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,3 @@
11
<?php
22

3-
$finder = \PhpCsFixer\Finder::create()
4-
->in(__DIR__ . '/src')
5-
->in(__DIR__ . '/tests');
6-
7-
return \PhpCsFixer\Config::create()
8-
->setRules([
9-
'@PSR2' => true,
10-
11-
'align_multiline_comment' => true,
12-
'array_indentation' => true,
13-
'array_syntax' => ['syntax' => 'short'],
14-
'backtick_to_shell_exec' => true,
15-
'binary_operator_spaces' => true,
16-
'blank_line_after_opening_tag' => true,
17-
'cast_spaces' => true,
18-
'class_attributes_separation' => ['elements' => ['method']],
19-
'combine_consecutive_issets' => true,
20-
'combine_consecutive_unsets' => true,
21-
'concat_space' => ['spacing' => 'one'],
22-
'declare_equal_normalize' => true,
23-
'dir_constant' => true,
24-
'ereg_to_preg' => true,
25-
'fully_qualified_strict_types' => true,
26-
'function_to_constant' => true,
27-
'function_typehint_space' => true,
28-
'heredoc_to_nowdoc' => true,
29-
'include' => true,
30-
'is_null' => true,
31-
'list_syntax' => ['syntax' => 'short'],
32-
'logical_operators' => true,
33-
'lowercase_cast' => true,
34-
'lowercase_static_reference' => true,
35-
'magic_constant_casing' => true,
36-
'modernize_types_casting' => true,
37-
'multiline_comment_opening_closing' => true,
38-
'multiline_whitespace_before_semicolons' => true,
39-
'native_constant_invocation' => true,
40-
'native_function_casing' => true,
41-
'native_function_invocation' => ['include' => ['@compiler_optimized']],
42-
'new_with_braces' => true,
43-
'no_alias_functions' => true,
44-
'no_binary_string' => true,
45-
'no_blank_lines_after_class_opening' => true,
46-
'no_blank_lines_after_phpdoc' => true,
47-
'no_empty_comment' => true,
48-
'no_empty_phpdoc' => true,
49-
'no_empty_statement' => true,
50-
'no_extra_blank_lines' => true,
51-
'no_homoglyph_names' => true,
52-
'no_leading_import_slash' => true,
53-
'no_leading_namespace_whitespace' => true,
54-
'no_mixed_echo_print' => true,
55-
'no_multiline_whitespace_around_double_arrow' => true,
56-
'no_php4_constructor' => true,
57-
'no_short_bool_cast' => true,
58-
'no_singleline_whitespace_before_semicolons' => true,
59-
'no_spaces_around_offset' => true,
60-
'no_trailing_comma_in_list_call' => true,
61-
'no_trailing_comma_in_singleline_array' => true,
62-
'no_unneeded_control_parentheses' => true,
63-
'no_unneeded_curly_braces' => true,
64-
'no_unneeded_final_method' => true,
65-
'no_unreachable_default_argument_value' => true,
66-
'no_unused_imports' => true,
67-
'no_useless_return' => true,
68-
'no_whitespace_before_comma_in_array' => true,
69-
'no_whitespace_in_blank_line' => true,
70-
'non_printable_character' => true,
71-
'normalize_index_brace' => true,
72-
'object_operator_without_whitespace' => true,
73-
'ordered_class_elements' => ['order' => ['use_trait', 'constant', 'property', 'construct', 'method']],
74-
'ordered_imports' => true,
75-
'php_unit_construct' => true,
76-
'php_unit_dedicate_assert' => ['target' => 'newest'],
77-
'php_unit_expectation' => true,
78-
'php_unit_mock' => true,
79-
'php_unit_namespaced' => true,
80-
'php_unit_no_expectation_annotation' => true,
81-
'php_unit_set_up_tear_down_visibility' => true,
82-
'php_unit_strict' => true,
83-
'php_unit_test_case_static_method_calls' => ['call_type' => 'this'],
84-
'phpdoc_add_missing_param_annotation' => true,
85-
'phpdoc_align' => ['align' => 'left'],
86-
'phpdoc_annotation_without_dot' => true,
87-
'phpdoc_indent' => true,
88-
'phpdoc_inline_tag' => true,
89-
'phpdoc_no_access' => true,
90-
'phpdoc_no_alias_tag' => true,
91-
'phpdoc_no_package' => true,
92-
'phpdoc_no_useless_inheritdoc' => true,
93-
'phpdoc_return_self_reference' => true,
94-
'phpdoc_scalar' => true,
95-
'phpdoc_single_line_var_spacing' => true,
96-
'phpdoc_summary' => true,
97-
'phpdoc_to_comment' => true,
98-
'phpdoc_trim' => true,
99-
'phpdoc_trim_consecutive_blank_line_separation' => true,
100-
'phpdoc_types' => true,
101-
'phpdoc_var_without_name' => true,
102-
'pow_to_exponentiation' => true,
103-
'psr4' => true,
104-
'return_type_declaration' => true,
105-
'self_accessor' => true,
106-
'semicolon_after_instruction' => true,
107-
'set_type_to_cast' => true,
108-
'short_scalar_cast' => true,
109-
'simplified_null_return' => true,
110-
'single_blank_line_before_namespace' => true,
111-
'single_line_comment_style' => true,
112-
'single_quote' => true,
113-
'space_after_semicolon' => true,
114-
'standardize_increment' => true,
115-
'standardize_not_equals' => true,
116-
'strict_comparison' => true,
117-
'strict_param' => true,
118-
'ternary_operator_spaces' => true,
119-
'ternary_to_null_coalescing' => true,
120-
'trailing_comma_in_multiline_array' => true,
121-
'trim_array_spaces' => true,
122-
'whitespace_after_comma_in_array' => true,
123-
])
124-
->setFinder($finder);
3+
return require __DIR__ . '/vendor/riimu/php-cs-fixer-config/config.php';

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"psr/container-implementation": "^1.0"
2626
},
2727
"require-dev": {
28-
"phpunit/phpunit": "^7.2"
28+
"phpunit/phpunit": "^7.2",
29+
"riimu/php-cs-fixer-config": "^0.1"
2930
},
3031
"autoload": {
3132
"psr-4": {

0 commit comments

Comments
 (0)