forked from Qsnh/meedu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.php_cs
46 lines (42 loc) · 1.33 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
40
41
42
43
44
45
46
<?php
$header = <<<EOF
This file is part of the Qsnh/meedu.
(c) XiaoTeng <[email protected]>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
EOF;
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'header_comment' => ['header' => $header],
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => [
'sort_algorithm' => 'length',
],
'not_operator_with_successor_space' => false,
'no_useless_else' => true,
'no_useless_return' => true,
'no_unused_imports' => true,
'yoda_style' => false,
'single_quote' => true,
'increment_style' => ['style' => 'post'],
// 三元运算符的空格
'ternary_operator_spaces' => true,
// .连接符两边空格,!没有空格
'unary_operator_spaces' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('addons')
->exclude('docker')
->exclude('docs')
->exclude('library')
->exclude('node_modules')
->exclude('public')
->exclude('resources')
->exclude('storage')
->exclude('templates')
->exclude('vendor')
->in(__DIR__)
);