1
1
<?php
2
2
3
+ /*
4
+ * Cypher DSL
5
+ * Copyright (C) 2021 Wikibase Solutions
6
+ *
7
+ * This program is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU General Public License
9
+ * as published by the Free Software Foundation; either version 2
10
+ * of the License, or (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
+ */
21
+
3
22
use PhpCsFixer \Config ;
4
23
use PhpCsFixer \Finder ;
5
24
6
25
$ finder = Finder::create ()
7
- ->in ([__DIR__ . '/src ' , __DIR__ . '/tests ' ])
8
- ->name ('*php ' );
26
+ ->in (__DIR__ )
27
+ ->exclude ([
28
+ '.github ' ,
29
+ 'vendor '
30
+ ])
31
+ ->name ('*php ' );
32
+
33
+ $ header = <<<'COPYRIGHT'
34
+ Cypher DSL
35
+ Copyright (C) 2021 Wikibase Solutions
36
+
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.
41
+
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.
50
+ COPYRIGHT;
9
51
10
52
return (new Config ())
11
- ->setRules ([
12
- '@PSR12 ' => true ,
13
- 'align_multiline_comment ' => true ,
14
- 'array_indentation ' => true ,
15
- 'blank_line_before_statement ' => [
16
- 'statements ' => [
17
- 'break ' ,
18
- 'continue ' ,
19
- 'declare ' ,
20
- 'do ' ,
21
- 'for ' ,
22
- 'foreach ' ,
23
- 'if ' ,
24
- 'include ' ,
25
- 'include_once ' ,
26
- 'require ' ,
27
- 'require_once ' ,
28
- 'return ' ,
29
- 'switch ' ,
30
- 'throw ' ,
31
- 'try ' ,
32
- 'while ' ,
33
- 'yield ' ,
34
- ],
35
- ],
36
- 'concat_space ' => ['spacing ' => 'one ' ],
37
- 'fully_qualified_strict_types ' => true ,
38
- 'list_syntax ' => [
39
- 'syntax ' => 'short ' ,
40
- ],
41
- 'no_unused_imports ' => true ,
42
- 'no_useless_else ' => true ,
43
- 'no_useless_return ' => true ,
44
- 'nullable_type_declaration_for_default_null_value ' => true ,
45
- 'ordered_class_elements ' => true ,
46
- 'ordered_imports ' => true ,
47
- 'phpdoc_align ' => [
48
- 'align ' => 'left ' ,
49
- ],
50
- 'phpdoc_scalar ' => true ,
51
- 'php_unit_method_casing ' => [
52
- 'case ' => 'snake_case ' ,
53
- ],
54
- 'phpdoc_order_by_value ' => [
55
- 'annotations ' => ['covers ' ],
56
- ],
57
- 'phpdoc_no_empty_return ' => true ,
58
- 'phpdoc_order ' => true ,
59
- 'return_assignment ' => true ,
60
- 'self_static_accessor ' => true ,
61
- 'simplified_if_return ' => true ,
62
- 'trailing_comma_in_multiline ' => true
63
- ])
64
- ->setFinder ($ finder )
65
- ->setCacheFile (__DIR__ . '/.php-cs-fixer.cache ' )
66
- ->setUsingCache (true );
53
+ ->setRules ([
54
+ '@PSR12 ' => true ,
55
+ 'align_multiline_comment ' => true ,
56
+ 'array_indentation ' => true ,
57
+ 'blank_line_before_statement ' => [
58
+ 'statements ' => [
59
+ 'break ' ,
60
+ 'continue ' ,
61
+ 'declare ' ,
62
+ 'do ' ,
63
+ 'for ' ,
64
+ 'foreach ' ,
65
+ 'if ' ,
66
+ 'include ' ,
67
+ 'include_once ' ,
68
+ 'require ' ,
69
+ 'require_once ' ,
70
+ 'return ' ,
71
+ 'switch ' ,
72
+ 'throw ' ,
73
+ 'try ' ,
74
+ 'while ' ,
75
+ 'yield ' ,
76
+ ],
77
+ ],
78
+ 'concat_space ' => ['spacing ' => 'one ' ],
79
+ 'fully_qualified_strict_types ' => true ,
80
+ 'header_comment ' => [
81
+ 'header ' => $ header
82
+ ],
83
+ 'list_syntax ' => [
84
+ 'syntax ' => 'short ' ,
85
+ ],
86
+ 'no_unused_imports ' => true ,
87
+ 'no_useless_else ' => true ,
88
+ 'no_useless_return ' => true ,
89
+ 'nullable_type_declaration_for_default_null_value ' => true ,
90
+ 'ordered_class_elements ' => true ,
91
+ 'ordered_imports ' => true ,
92
+ 'phpdoc_align ' => [
93
+ 'align ' => 'left ' ,
94
+ ],
95
+ 'phpdoc_scalar ' => true ,
96
+ 'php_unit_method_casing ' => [
97
+ 'case ' => 'snake_case ' ,
98
+ ],
99
+ 'phpdoc_order_by_value ' => [
100
+ 'annotations ' => ['covers ' ],
101
+ ],
102
+ 'phpdoc_no_empty_return ' => true ,
103
+ 'phpdoc_order ' => true ,
104
+ 'return_assignment ' => true ,
105
+ 'self_static_accessor ' => true ,
106
+ 'simplified_if_return ' => true ,
107
+ 'trailing_comma_in_multiline ' => true
108
+ ])
109
+ ->setFinder ($ finder );
0 commit comments