-
Notifications
You must be signed in to change notification settings - Fork 345
/
.php-cs-fixer.php
57 lines (51 loc) · 1.58 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
52
53
54
55
56
57
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('client')
->exclude('utils')
->in(__DIR__)
->name('*.phtml');
$rules = [
'@Symfony' => true,
// why would anyone put braces on different line
'braces_position' => [
'functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'same_line',
],
'function_declaration' => [
'closure_function_spacing' => 'none',
'closure_fn_spacing' => 'none',
],
// overwrite some Symfony rules
'concat_space' => ['spacing' => 'one'],
'global_namespace_import' => false,
'blank_line_between_import_groups' => false,
// We need the `mixed`s for PHPStan.
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'phpdoc_align' => false,
'phpdoc_no_empty_return' => false,
'phpdoc_summary' => false,
'trailing_comma_in_multiline' => false,
'yoda_style' => false,
'semicolon_after_instruction' => false,
// additional rules
'dir_constant' => true,
'echo_tag_syntax' => ['format' => 'short'],
'modernize_types_casting' => true,
'no_alias_functions' => true,
'ordered_imports' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
// 'phpdoc_to_param_type' => true,
// 'phpdoc_to_return_type' => true,
'psr_autoloading' => true,
'strict_param' => true,
'declare_strict_types' => true,
'simple_to_complex_string_variable' => true,
];
$config = new PhpCsFixer\Config();
return $config
->setRules($rules)
->setRiskyAllowed(true)
->setFinder($finder);