-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php_cs
39 lines (36 loc) · 1.1 KB
/
.php_cs
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
<?php
use PhpCsFixer\Finder;
use PhpCsFixer\Config;
$finder = Finder::create()
->exclude('bootstrap/cache')
->exclude('storage')
->exclude('vendor')
->exclude('app/Helpers/Tools')
->exclude('tools')
->in(__DIR__)
->ignoreDotFiles(true)
->ignoreVCS(true);
return Config::create()
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_superfluous_elseif' => true,
'no_unneeded_curly_braces' => true,
'phpdoc_order' => true,
'phpdoc_types_order' => true,
'align_multiline_comment' => true,
'list_syntax' => [
'syntax' => 'long', // list 使用 long 语法
],
'ordered_class_elements' => true,
'php_unit_strict' => true,
'whitespace_after_comma_in_array' => true,
'blank_line_before_return' => true
])
->setUsingCache(false)
->setFinder($finder);