-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.php-cs-fixer.dist.php
110 lines (101 loc) · 3.24 KB
/
.php-cs-fixer.dist.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
/**
* This file is part of the package magicsunday/webtrees-module-base.
*
* For the full copyright and license information, please read the
* LICENSE file 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 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())
->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
'@PER-CS2.0' => 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',
],
'phpdoc_to_comment' => false,
'phpdoc_no_alias_tag' => 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',
],
],
'yoda_style' => [
'equal' => false,
'identical' => false,
'less_and_greater' => false,
'always_move_variable' => false,
],
'blank_line_before_statement' => [
'statements' => [
'return',
'if',
'throw',
],
],
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('.build')
->exclude('.github')
->in(__DIR__)
);