-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.php-cs-fixer.dist.php
More file actions
69 lines (67 loc) · 2.18 KB
/
.php-cs-fixer.dist.php
File metadata and controls
69 lines (67 loc) · 2.18 KB
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
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('var')
->exclude('vendor')
->exclude('node_modules')
->notPath('src/Kernel.php')
->notPath('tests/object-manager.php')
->notPath('tests/bootstrap.php')
->notPath('public/index.php')
->notPath('config/preload.php')
->notPath('importmap.php')
;
return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'list_syntax' => ['syntax' => 'short'],
'ordered_imports' => [
'sort_algorithm' => 'alpha',
'imports_order' => ['class', 'function', 'const'],
],
'single_import_per_statement' => true,
'blank_line_between_import_groups' => true,
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => [
'elements' => ['arrays', 'arguments', 'parameters'],
],
'concat_space' => [
'spacing' => 'one',
],
'unary_operator_spaces' => true,
'yoda_style' => true,
'binary_operator_spaces' => [
'default' => 'single_space',
],
'return_type_declaration' => ['space_before' => 'none'],
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'single_line_throw' => false,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
'property' => 'one',
],
],
'visibility_required' => [
'elements' => ['property', 'method', 'const'],
],
'native_function_invocation' => [
'include' => ['@compiler_optimized'],
'scope' => 'namespaced',
],
'declare_strict_types' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'phpdoc_align' => ['align' => 'left'],
'phpdoc_order' => true,
'phpdoc_trim' => true,
])
->setFinder($finder)
->setRiskyAllowed(true)
;