|
31 | 31 | ->name('*php');
|
32 | 32 |
|
33 | 33 | $header = <<<'COPYRIGHT'
|
34 |
| -Cypher DSL |
35 |
| -Copyright (C) 2021 Wikibase Solutions |
| 34 | +This file is part of php-cypher-dsl. |
36 | 35 |
|
37 |
| -This program is free software; you can redistribute it and/or |
38 |
| -modify it under the terms of the GNU General Public License |
39 |
| -as published by the Free Software Foundation; either version 2 |
40 |
| -of the License, or (at your option) any later version. |
| 36 | +Copyright (C) 2021- Wikibase Solutions |
41 | 37 |
|
42 |
| -This program is distributed in the hope that it will be useful, |
43 |
| -but WITHOUT ANY WARRANTY; without even the implied warranty of |
44 |
| -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
45 |
| -GNU General Public License for more details. |
46 |
| -
|
47 |
| -You should have received a copy of the GNU General Public License |
48 |
| -along with this program; if not, write to the Free Software |
49 |
| -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 38 | +For the full copyright and license information, please view the LICENSE |
| 39 | +file that was distributed with this source code. |
50 | 40 | COPYRIGHT;
|
51 | 41 |
|
52 | 42 | return (new Config())
|
| 43 | + ->setRiskyAllowed(true) |
53 | 44 | ->setRules([
|
54 | 45 | '@PSR12' => true,
|
55 | 46 | 'align_multiline_comment' => true,
|
|
75 | 66 | 'yield',
|
76 | 67 | ],
|
77 | 68 | ],
|
| 69 | + 'compact_nullable_typehint' => true, |
78 | 70 | 'concat_space' => ['spacing' => 'one'],
|
| 71 | + 'declare_strict_types' => true, |
| 72 | + 'declare_equal_normalize' => true, |
79 | 73 | 'fully_qualified_strict_types' => true,
|
| 74 | + 'global_namespace_import' => [ |
| 75 | + 'import_classes' => true, |
| 76 | + 'import_constants' => false, |
| 77 | + 'import_functions' => false |
| 78 | + ], |
80 | 79 | 'header_comment' => [
|
81 |
| - 'header' => $header |
| 80 | + 'header' => $header, |
| 81 | + 'separate' => 'none' |
82 | 82 | ],
|
83 | 83 | 'list_syntax' => [
|
84 | 84 | 'syntax' => 'short',
|
85 | 85 | ],
|
| 86 | + 'logical_operators' => true, |
| 87 | + 'no_superfluous_phpdoc_tags' => true, |
| 88 | + 'no_unset_cast' => true, |
86 | 89 | 'no_unused_imports' => true,
|
87 | 90 | 'no_useless_else' => true,
|
88 | 91 | 'no_useless_return' => true,
|
89 | 92 | 'nullable_type_declaration_for_default_null_value' => true,
|
90 | 93 | 'ordered_class_elements' => true,
|
91 | 94 | 'ordered_imports' => true,
|
| 95 | + 'ordered_interfaces' => true, |
| 96 | + 'ordered_traits' => true, |
92 | 97 | 'phpdoc_align' => [
|
93 | 98 | 'align' => 'left',
|
94 | 99 | ],
|
95 | 100 | 'phpdoc_scalar' => true,
|
| 101 | + 'phpdoc_order_by_value' => [ |
| 102 | + 'annotations' => ['covers'], |
| 103 | + ], |
| 104 | + 'phpdoc_no_empty_return' => true, |
| 105 | + 'phpdoc_order' => true, |
| 106 | + 'php_unit_dedicate_assert' => true, |
| 107 | + 'php_unit_set_up_tear_down_visibility' => true, |
96 | 108 | 'php_unit_method_casing' => [
|
97 |
| - 'case' => 'snake_case', |
98 |
| - ], |
99 |
| - 'phpdoc_order_by_value' => [ |
100 |
| - 'annotations' => ['covers'], |
| 109 | + 'case' => 'camel_case', |
101 | 110 | ],
|
102 |
| - 'phpdoc_no_empty_return' => true, |
103 |
| - 'phpdoc_order' => true, |
| 111 | + 'php_unit_test_annotation' => [ |
| 112 | + 'style' => 'prefix', |
| 113 | + ], |
| 114 | + 'php_unit_test_case_static_method_calls' => [ |
| 115 | + 'call_type' => 'this', |
| 116 | + ], |
104 | 117 | 'return_assignment' => true,
|
105 | 118 | 'self_static_accessor' => true,
|
| 119 | + 'single_line_throw' => true, |
106 | 120 | 'simplified_if_return' => true,
|
107 |
| - 'trailing_comma_in_multiline' => true |
| 121 | + 'static_lambda' => true, |
| 122 | + 'strict_comparison' => true, |
| 123 | + 'strict_param' => true, |
| 124 | + 'trailing_comma_in_multiline' => true, |
| 125 | + 'yoda_style' => [ |
| 126 | + 'equal' => false, |
| 127 | + 'identical' => false, |
| 128 | + 'less_and_greater' => false, |
| 129 | + ] |
108 | 130 | ])
|
109 | 131 | ->setFinder($finder);
|
0 commit comments