-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.php_cs
51 lines (46 loc) · 1.4 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
47
48
49
50
51
<?php
use PhpCsFixer\Config;
use Symfony\Component\Finder\Finder;
$excludeDirs = [
'vendor/',
];
$excludeFiles = [
'.php_cs.dist',
'.phpstorm.meta.php',
'_ide_helper.php',
'_ide_helper_models.php',
'artisan',
'server.php',
];
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->name('*.php')
->exclude($excludeDirs)
->notPath($excludeFiles)
->ignoreDotFiles(true)
->ignoreVCS(true);
return Config::create()
->setRules([
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => true,
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_return' => true,
'braces' => true,
'class_definition' => true,
'method_chaining_indentation' => true,
'no_extra_consecutive_blank_lines' => true,
'no_multiline_whitespace_before_semicolons' => true,
'no_short_echo_tag' => true,
'no_spaces_around_offset' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
'not_operator_with_successor_space' => true,
'ordered_imports' => ['sortAlgorithm' => 'length'],
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'single_quote' => true,
])
->setFinder($finder);