-
Notifications
You must be signed in to change notification settings - Fork 1
/
.php-cs-fixer.php
51 lines (51 loc) · 1.77 KB
/
.php-cs-fixer.php
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
$finder = (new PhpCsFixer\Finder())
->in(
[
__DIR__.'/src'
]
);
return (new PhpCsFixer\Config())
->setFinder($finder)
->setRiskyAllowed(true)
->setUsingCache(false) // cache is always an issue when you switch branch because the cached file is ignored by git
->setRules([
'@Symfony' => true,
// risky rules
'@Symfony:risky' => true,
'strict_comparison' => true,
'strict_param' => true,
// non risky rules
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'declare_strict_types' => true,
'dir_constant' => true,
'fully_qualified_strict_types' => true,
'linebreak_after_opening_tag' => true,
'mb_str_functions' => true,
'modernize_types_casting' => true,
'no_alternative_syntax' => true,
'multiline_whitespace_before_semicolons' => true,
'no_null_property_initialization' => true,
'no_php4_constructor' => true,
'echo_tag_syntax' => ['format' => 'long'],
'no_superfluous_elseif' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'phpdoc_to_comment' => false,
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
'sort_algorithm' => 'none'
],
'php_unit_set_up_tear_down_visibility' => true,
'pow_to_exponentiation' => true,
'protected_to_private' => true,
'semicolon_after_instruction' => true,
'ternary_to_null_coalescing' => true,
])
;