-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
82 lines (78 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
<?php
$header = <<<'EOF'
This file is part of pmg/assertion-grant.
Copyright (c) PMG <https://www.pmg.com>
For full copyright and license information, please view the LICENSE file
that was distributed with this source code.
EOF;
return (new PhpCsFixer\Config())
->setUsingCache(false)
->setRiskyAllowed(true)
->setRules([
'array_syntax' => ['syntax' => 'short'],
'braces' => true,
'blank_line_after_namespace' => true,
'cast_spaces' => true,
'combine_consecutive_unsets' => true,
'concat_space' => ['spacing' => 'none'],
'elseif' => true,
'encoding' => true,
'function_typehint_space' => true,
'header_comment' => [
'header' => $header,
'separate' => 'bottom',
'location' => 'after_declare_strict',
'comment_type' => 'PHPDoc',
],
'indentation_type' => true,
'line_ending' => true,
'lowercase_keywords' => true,
'new_with_braces' => true,
'no_closing_tag' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => [
'tokens' => [
'break',
'continue',
'extra',
'return',
'use',
'use_trait',
],
],
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'object_operator_without_whitespace' => true,
'self_accessor' => true,
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'single_quote' => true,
'trailing_comma_in_multiline' => [
'elements' => ['arrays'],
],
'unary_operator_spaces' => true,
'visibility_required' => [
'elements' => ['property', 'method'],
],
'whitespace_after_comma_in_array' => true,
'declare_strict_types' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->in([
__DIR__.'/src',
__DIR__.'/test',
])
);