-
Notifications
You must be signed in to change notification settings - Fork 13
/
.php_cs.dist.php
59 lines (56 loc) · 1.87 KB
/
.php_cs.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
<?php
$rules = [
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => true,
'ternary_operator_spaces' => true,
'ternary_to_null_coalescing' => true,
'multiline_whitespace_before_semicolons' => true,
'no_leading_namespace_whitespace' => true,
'braces' => true,
'cast_spaces' => true,
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'],
'constant_case' => true,
'declare_equal_normalize' => true,
'elseif' => true,
'encoding' => true,
'full_opening_tag' => true,
'function_declaration' => true,
'function_typehint_space' => true,
'global_namespace_import' => ['import_classes' => true],
'linebreak_after_opening_tag' => true,
'lowercase_cast' => true,
'method_chaining_indentation' => true,
'multiline_comment_opening_closing' => true,
'no_empty_comment' => true,
'no_closing_tag' => true,
'no_blank_lines_before_namespace' => true,
'no_blank_lines_after_phpdoc' => true,
'no_blank_lines_after_class_opening' => true,
'no_empty_statement' => true,
'no_short_bool_cast' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
'group_import' => true
];
$finder = Symfony\Component\Finder\Finder::create()
->exclude("vendor")
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return (new PhpCsFixer\Config())
->setUsingCache(true)
->setRules($rules)
->setFinder($finder);