-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
70 lines (63 loc) · 2.37 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
<?php
/**
* This file is part of the BB-One Role Playing Game application.
*
* PHP 7.4
*
* (c) Alexandre Tranchant <[email protected]>
* (c) Longitude One 2020
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude('var')
->exclude('vendor')
;
$header = <<<'EOF'
This file is part of the Banned Bundle.
PHP 7.4 | 8.0
(c) Alexandre Tranchant <[email protected]>
(c) Longitude One 2020 - 2021
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;
return (new PhpCsFixer\Config())
->setCacheFile('.php-cs-fixer.cache')
->setRules([
'@PHPUnit75Migration:risky' => true,
'@PhpCsFixer' => true,
'@Symfony' => true,
'@PSR12' => true,
'declare_strict_types' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => $header,
'location' => 'after_open',
'separate' => 'bottom',
],
'ordered_class_elements' => [
'order' => [
'use_trait',
'constant_public', 'constant_protected', 'constant_private', 'constant',
'property_public_static', 'property_protected_static', 'property_private_static', 'property_static',
'property_public', 'property_protected', 'property_private', 'property',
'construct', 'destruct',
'phpunit',
'method_public_static', 'method_protected_static', 'method_private_static', 'method_static',
'method_public', 'method_protected', 'method_private', 'method', 'magic',
],
'sort_algorithm' => 'alpha',
],
'linebreak_after_opening_tag' => true,
// 'modernize_types_casting' => true,
'no_useless_return' => true,
'no_extra_blank_lines' => ['tokens' => ['case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'switch', 'throw', 'use_trait']],
// 'phpdoc_add_missing_param_annotation' => true,
// 'protected_to_private' => true,
'strict_param' => true,
'php_unit_test_class_requires_covers' => false,
])
->setFinder($finder)
;