-
-
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
100 lines (97 loc) · 3.42 KB
/
Copy path.php-cs-fixer.dist.php
File metadata and controls
100 lines (97 loc) · 3.42 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
declare(strict_types=1);
/**
* PHP-CS-Fixer configuration (PSR-12 + Symfony canonical).
* Standard for Nowo bundles. Run: make cs-check | make cs-fix
*/
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
return (new Config())
->setParallelConfig(ParallelConfigFactory::detect())
->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'declare_strict_types' => true,
'ordered_imports' => [
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha',
],
'single_import_per_statement' => true,
'no_unused_imports' => true,
'no_leading_import_slash' => true,
'single_line_after_imports' => true,
'array_syntax' => ['syntax' => 'short'],
'trailing_comma_in_multiline' => [
'elements' => ['arguments', 'arrays', 'match'],
],
'concat_space' => ['spacing' => 'one'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => [
'=>' => 'align_single_space_minimal',
'=' => 'align_single_space_minimal',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
],
'no_extra_blank_lines' => [
'tokens' => ['extra', 'throw', 'use'],
],
'no_trailing_whitespace' => true,
'no_whitespace_in_blank_line' => true,
'single_blank_line_at_eof' => true,
'blank_line_after_opening_tag' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'simplified_if_return' => true,
'single_line_throw' => true,
'no_superfluous_elseif' => true,
'switch_continue_to_break' => true,
'phpdoc_order' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
'sort_algorithm' => 'alpha',
],
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'remove_inheritdoc' => false,
],
'phpdoc_align' => [
'align' => 'left',
'tags' => ['param', 'property', 'return', 'throws', 'type', 'var'],
],
'phpdoc_no_empty_return' => false,
'phpdoc_add_missing_param_annotation' => false,
'no_null_property_initialization' => true,
'single_line_comment_style' => ['comment_types' => ['hash']],
'yoda_style' => [
'equal' => false,
'identical' => false,
'less_and_greater' => false,
],
'modernize_types_casting' => true,
'no_short_bool_cast' => true,
'explicit_string_variable' => true,
'fully_qualified_strict_types' => true,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
])
->setFinder(
(new Finder())
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
->exclude(['vendor', 'var', 'coverage', '.phpunit.cache'])
->notPath('namespace-stubs.php')
->name('*.php')
);