-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.php-cs-fixer.dist.php
73 lines (62 loc) · 2.13 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
<?php
/**
* This file is part of the php-svg-optimizer package.
* (c) Mathias Reker <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
$header = <<<'EOD'
This file is part of the php-svg-optimizer package.
(c) Mathias Reker <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOD;
$finder = PhpCsFixer\Finder::create()
->ignoreDotFiles(false)
->in([__DIR__]);
$config = new PhpCsFixer\Config();
$config->setRiskyAllowed(true)
->setRules([
// Header
'header_comment' => [
'header' => $header,
'comment_type' => 'PHPDoc',
'location' => 'after_open',
'separate' => 'bottom',
],
// Migration Rules
'@PHP83Migration' => true,
'@PHP82Migration:risky' => true,
'@PHPUnit100Migration:risky' => true,
// Doctrine Rules
'@DoctrineAnnotation' => true,
// In no presets
'attribute_empty_parentheses' => true,
'heredoc_closing_marker' => true,
'multiline_string_to_heredoc' => true,
'numeric_literal_separator' => true,
'ordered_attributes' => true,
'php_unit_attributes' => true,
'return_to_yield_from' => true,
'phpdoc_tag_casing' => true,
'phpdoc_param_order' => true,
'mb_str_functions' => true,
'date_time_immutable' => true,
'ordered_interfaces' => true,
'general_phpdoc_annotation_remove' => [
'annotations' => ['expectedDeprecation'],
],
// PHP-CS-Fixer Rules
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
// Symfony Rules
'@Symfony' => true,
'@Symfony:risky' => true,
'concat_space' => ['spacing' => 'one'],
// Disable rule causing issues
'multiline_whitespace_before_semicolons' => false,
])
->setFinder($finder)
->setLineEnding(PHP_EOL);
return $config;