forked from kint-php/kint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php_cs
122 lines (120 loc) · 4.7 KB
/
.php_cs
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
120
121
122
<?php
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'class_keyword_remove' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'dir_constant' => true,
'escape_implicit_backslashes' => [
'single_quoted' => true,
],
'explicit_indirect_variable' => true,
'explicit_string_variable' => true,
'fully_qualified_strict_types' => true,
'header_comment' => [
'header' => \trim(\file_get_contents(__DIR__.'/LICENSE')),
],
'is_null' => true,
'linebreak_after_opening_tag' => true,
'list_syntax' => [
'syntax' => 'long',
],
'method_chaining_indentation' => true,
'modernize_types_casting' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
'native_function_invocation' => true,
'no_alias_functions' => true,
'no_alternative_syntax' => true,
'no_blank_lines_before_namespace' => false,
'no_homoglyph_names' => true,
'no_null_property_initialization' => false,
'no_superfluous_elseif' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'non_printable_character' => true,
'ordered_class_elements' => [
'order' => [
'use_trait',
'constant_public',
'constant_protected',
'constant_private',
'property_public_static',
'property_protected_static',
'property_private_static',
'property_public',
'property_protected',
'property_private',
'construct',
'destruct',
'magic',
'phpunit',
'method_public',
'method_protected',
'method_private',
'method_public_static',
'method_protected_static',
'method_private_static',
],
'sortAlgorithm' => 'none',
],
'ordered_imports' => [
'sortAlgorithm' => 'alpha',
],
'php_unit_construct' => true,
'php_unit_dedicate_assert' => [
'target' => '5.6',
],
'php_unit_namespaced' => false, // Causes issues with multiple phpunit versions
'php_unit_ordered_covers' => true,
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_strict' => false,
'php_unit_test_annotation' => false,
'php_unit_test_class_requires_covers' => false, // I wish this worked properly :(
'phpdoc_add_missing_param_annotation' => [
'only_untyped' => false,
],
'phpdoc_order' => true,
'phpdoc_to_comment' => false, // Required for certain Psalm workarounds
'phpdoc_types_order' => true,
'psr4' => true,
'simplified_null_return' => false,
'strict_param' => true,
'string_line_ending' => true,
'self_accessor' => false,
'static_lambda' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude(['build', 'tests/Fixtures'])
->append([__FILE__])
);