-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.php-cs-fixer.php
109 lines (106 loc) · 3.89 KB
/
.php-cs-fixer.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
<?php
declare(strict_types=1);
/*
* Twig plugin for Kint
* Copyright (C) 2017 Jonathan Vollebregt
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'array_indentation' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'dir_constant' => true,
'string_implicit_backslashes' => [
'single_quoted' => 'escape',
],
'explicit_indirect_variable' => true,
'explicit_string_variable' => true,
'fully_qualified_strict_types' => true,
'header_comment' => [
'header' => \trim(\file_get_contents(__DIR__.'/LICENSE.short')),
],
'is_null' => true,
'list_syntax' => true,
'method_chaining_indentation' => true,
'modernize_types_casting' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
'native_function_invocation' => [
'include' => ['@all'],
],
'no_alias_functions' => true,
'no_homoglyph_names' => true,
'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',
],
'sort_algorithm' => 'none',
],
'php_unit_construct' => [
'assertions' => ['assertSame', 'assertNotSame'],
],
'php_unit_dedicate_assert' => true,
'php_unit_namespaced' => true,
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_test_annotation' => true,
'php_unit_test_class_requires_covers' => true,
'phpdoc_to_comment' => false, // Required for certain Psalm workarounds
'phpdoc_types_order' => true,
'strict_param' => true,
'string_line_ending' => true,
'self_accessor' => true,
'declare_strict_types' => true,
'global_namespace_import' => [
'import_constants' => false,
'import_functions' => false,
'import_classes' => true,
],
'operator_linebreak' => [
'only_booleans' => true,
'position' => 'end',
],
'no_null_property_initialization' => false,
'trailing_comma_in_multiline' => [
'elements' => ['array_destructuring', 'arrays', 'match'],
],
])
->setFinder(PhpCsFixer\Finder::create()->in(__DIR__));