-
Notifications
You must be signed in to change notification settings - Fork 1
/
.php_cs.dist
58 lines (53 loc) · 1.55 KB
/
.php_cs.dist
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
<?php
// set directories should be fix
$directories = [
'config',
'src',
'database',
'routes',
'tests',
];
$finder = PhpCsFixer\Finder::create();
foreach ($directories as $directory) {
$finder->in(__DIR__ . '/' . $directory);
}
$PSR12 = [
'blank_line_after_opening_tag' => true,
'braces' => ['allow_single_line_closure' => true],
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'none'],
'function_typehint_space' => true,
'new_with_braces' => true,
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
],
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_whitespace_in_blank_line' => true,
'return_type_declaration' => ['space_before' => 'none'],
'single_trait_insert_per_statement' => true,
];
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'@Symfony' => true,
'cast_spaces' => [
'space' => 'none',
],
'phpdoc_align' => [
'tags' => ['method', 'property', 'return', 'throws', 'type', 'var'],
],
'phpdoc_order' => true,
'phpdoc_to_comment' => false,
'ternary_to_null_coalescing' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'array_syntax' => [
'syntax' => 'short',
],
] + $PSR12)
->setFinder($finder)
;