-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.php-cs-fixer.dist.php
More file actions
130 lines (122 loc) · 4 KB
/
.php-cs-fixer.dist.php
File metadata and controls
130 lines (122 loc) · 4 KB
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
123
124
125
126
127
128
129
130
<?php
/**
* This file is part of the package magicsunday/webtrees-module-base.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* This file represents the configuration for Code Sniffing PSR-2-related
* automatic checks of coding guidelines
* Install @fabpot's great php-cs-fixer tool via
*
* $ composer global require friendsofphp/php-cs-fixer
*
* And then simply run
*
* $ php-cs-fixer fix
*
* For more information read:
* http://www.php-fig.org/psr/psr-2/
* http://cs.sensiolabs.org
*/
if (PHP_SAPI !== 'cli') {
die('This script supports command line usage only. Please check your command.');
}
$header = <<<EOF
This file is part of the package magicsunday/webtrees-module-base.
For the full copyright and license information, please read the
LICENSE file that was distributed with this source code.
EOF;
return (new PhpCsFixer\Config())
->setCacheFile(__DIR__ . '/.build/cache/.php-cs-fixer.cache')
->setRiskyAllowed(true)
->setParallelConfig(new PhpCsFixer\Runner\Parallel\ParallelConfig(4, 8))
->setRules([
'@PER-CS2x0' => true,
'@Symfony' => true,
// Additional custom rules
'declare_strict_types' => true,
'concat_space' => [
'spacing' => 'one',
],
'header_comment' => [
'header' => $header,
'comment_type' => 'PHPDoc',
'location' => 'after_open',
'separate' => 'both',
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
],
'phpdoc_to_comment' => false,
'phpdoc_no_alias_tag' => false,
'phpdoc_annotation_without_dot' => false,
'no_superfluous_phpdoc_tags' => false,
'phpdoc_separation' => [
'groups' => [
[
'author',
'license',
'link',
],
],
],
'no_alias_functions' => true,
'whitespace_after_comma_in_array' => [
'ensure_single_space' => true,
],
'single_line_throw' => false,
'self_accessor' => false,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
'function_declaration' => [
'closure_function_spacing' => 'one',
'closure_fn_spacing' => 'one',
],
'binary_operator_spaces' => [
'operators' => [
'=' => 'align_single_space_minimal',
'=>' => 'align_single_space_minimal',
'+=' => 'align_single_space_minimal',
'-=' => 'align_single_space_minimal',
'.=' => 'align_single_space_minimal',
'??=' => 'align_single_space_minimal',
],
],
'yoda_style' => [
'equal' => false,
'identical' => false,
'less_and_greater' => false,
'always_move_variable' => false,
],
'blank_line_before_statement' => [
'statements' => [
'break',
'continue',
'for',
'foreach',
'if',
'return',
'switch',
'throw',
'try',
'while',
],
],
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude([
'.build',
'node_modules',
])
->in([
__DIR__ . '/src/',
__DIR__ . '/tests/',
])
);