-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
107 lines (95 loc) · 2.61 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
<?php
declare(strict_types=1);
/**
* This file is part of the MultiFlexi package
*
* https://multiflexi.eu/
*
* (c) Vítězslav Dvořák <http://vitexsoftware.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Ergebnis\PhpCsFixer\Config\Factory;
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet\Php74;
$header = <<<'HEADER'
This file is part of the MultiFlexi package
https://multiflexi.eu/
(c) Vítězslav Dvořák <http://vitexsoftware.com>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
HEADER;
$ruleSet = Php74::create()->withHeader($header)->withRules(Rules::fromArray([
'blank_line_before_statement' => [
'statements' => [
'break',
'continue',
'declare',
'default',
'do',
'exit',
'for',
'foreach',
'goto',
'if',
'include',
'include_once',
'require',
'require_once',
'return',
'switch',
'throw',
'try',
'while',
],
],
'concat_space' => [
'spacing' => 'none',
],
'date_time_immutable' => false,
'error_suppression' => false,
'final_class' => false,
'mb_str_functions' => false,
'native_function_invocation' => [
'exclude' => [
'sprintf',
],
'include' => [
'@compiler_optimized',
],
'scope' => 'all',
'strict' => false,
],
'php_unit_internal_class' => false,
'php_unit_test_annotation' => [
'style' => 'prefix',
],
'php_unit_test_class_requires_covers' => false,
'return_to_yield_from' => false,
'phpdoc_array_type' => false,
'phpdoc_list_type' => false,
'attribute_empty_parentheses' => false,
'final_public_method_for_abstract_class' => false,
'class_attributes_separation' => [
'elements' => [
'const' => 'only_if_meta',
'property' => 'only_if_meta',
'trait_import' => 'none',
'case' => 'none',
],
],
'yoda_style' => false,
'php_unit_test_case_static_method_calls' => false,
]));
$config = Factory::fromRuleSet($ruleSet);
$config->getFinder()
->append([
__DIR__.'/.php-cs-fixer.dist.php',
])
->in('db')
->in('lib')
->in('src')
->in('tests');
$config->setCacheFile(__DIR__.'/.build/php-cs-fixer/.php-cs-fixer.cache');
return $config;