-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
75 lines (65 loc) · 2.55 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
<?php
/*
* This file is part of the Calculation package.
*
* (c) bibi.nu <bibi@bibi.nu>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
$comment = <<<COMMENT
This file is part of the Calculation package.
(c) bibi.nu <bibi@bibi.nu>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
COMMENT;
$rules = [
// --------------------------------------------------------------
// Rule sets
// --------------------------------------------------------------
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP82Migration' => true,
'@PHP82Migration:risky' => true,
'@DoctrineAnnotation' => true,
'@PHPUnit100Migration:risky' => true,
// --------------------------------------------------------------
// Rules override
// --------------------------------------------------------------
'method_chaining_indentation' => true,
'native_function_invocation' => ['include' => ['@internal', 'all']],
'final_internal_class' => true,
'header_comment' => ['header' => $comment, 'location' => 'after_open', 'separate' => 'bottom'],
'blank_line_before_statement' => ['statements' => ['declare', 'try', 'return']],
'no_unused_imports' => true,
'strict_comparison' => true,
'strict_param' => true,
'ordered_imports' => ['imports_order' => ['const', 'class', 'function']],
'ordered_class_elements' => ['sort_algorithm' => 'alpha'],
'concat_space' => ['spacing' => 'one'],
'array_syntax' => ['syntax' => 'short'],
'list_syntax' => ['syntax' => 'short'],
'doctrine_annotation_array_assignment' => ['operator' => '='],
'ordered_interfaces' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'php_unit_strict' => true,
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
'phpdoc_to_comment' => ['allow_before_return_statement' => true],
'attribute_empty_parentheses' => ['use_parentheses' => false],
'new_with_braces' => ['anonymous_class' => true, 'named_class' => true],
];
$finder = Finder::create()
->in(__DIR__ . '/config')
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests');
$config = new Config();
return $config
->setParallelConfig(ParallelConfigFactory::detect())
->setRiskyAllowed(true)
->setFinder($finder)
->setRules($rules);