forked from FOSSBilling/FOSSBilling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
48 lines (45 loc) · 2.22 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
<?php
/**
* Copyright 2022-2024 FOSSBilling
* Copyright 2011-2021 BoxBilling, Inc.
* SPDX-License-Identifier: Apache-2.0
*
* @copyright FOSSBilling (https://www.fossbilling.org)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
*/
if (!file_exists(__DIR__ . '/src')) {
exit(0);
}
return (new PhpCsFixer\Config())
->setRules([
'@PHP80Migration' => true,
'@Symfony' => true,
'concat_space' => ['spacing' => 'one'],
'protected_to_private' => false,
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => false],
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], // Enforce non-Yoda style.
'blank_line_before_statement' => ['statements' => ['break', 'continue', 'return', 'throw', 'try']], // Removed 'declare' from the default list.
/* Risky */
'get_class_to_class_keyword' => true, // Risky if the get_class function is overridden. In our case, it's not.
'dir_constant' => true, // Risky when the function dirname is overridden. In our case, it's not.
'array_push' => true, // Risky when the function array_push is overridden. In our case, it's not.
'no_useless_sprintf' => true, // Risky when the function sprintf is overridden. In our case, it's not.
'php_unit_construct' => true, // https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/php_unit/php_unit_construct.rst
'php_unit_mock_short_will_return' => true, // https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/php_unit/php_unit_mock_short_will_return.rst
'no_homoglyph_names' => true, // https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/naming/no_homoglyph_names.rst
])
->setRiskyAllowed(true)
->setFinder(
(new PhpCsFixer\Finder())
->in([__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/tests-legacy'])
->exclude([
'data',
'locale',
'themes',
'vendor',
])
->notPath(
'config-sample.php'
)
)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect());