-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.php-cs-fixer.php
85 lines (70 loc) · 2.14 KB
/
.php-cs-fixer.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
83
84
85
<?php
# vim: expandtab syntax=php
declare(strict_types=1);
$finder = Symfony\Component\Finder\Finder::create()
->ignoreDotFiles(true)
->ignoreVCS(true)
->in([
__DIR__ . '/src',
])
->name('*.php')
->notName('*.blade.php')
;
$config = new PhpCsFixer\Config();
$config
->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
'@PSR2' => true,
//'@PhpCsFixer:risky' => true,
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => [
'syntax' => 'long',
],
'binary_operator_spaces' => [
'default' => 'align_single_space_minimal',
],
'blank_line_after_namespace' => true,
'blank_line_before_statement' => [
'statements' => [
//'break',
//'continue',
'declare',
'return',
//'throw',
'switch',
'try',
],
],
'concat_space' => [
'spacing' => 'one',
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'no_superfluous_phpdoc_tags' => false,
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'ordered_imports' => [
'sort_algorithm' => 'alpha',
],
'phpdoc_align' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => false,
'phpdoc_var_without_name' => true,
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
'sort_algorithm' => 'none',
],
'trailing_comma_in_multiline' => [
'elements' => [
'arrays',
],
],
'unary_operator_spaces' => true,
])
->setFinder($finder);
return $config;