-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path.php-cs-fixer.php
66 lines (60 loc) · 1.88 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
58
59
60
61
62
63
64
65
66
<?php
use PhpCsFixer\Config;
$blacklistedFiles = [
'credentials.php',
];
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/examples')
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
->filter(function(SplFileInfo $file) use ($blacklistedFiles) {
return !in_array($file->getFilename(), $blacklistedFiles, true);
})
;
return (new Config())
->setRules([
'@PSR12' => true,
'@Symfony' => true,
// Fix declare style
'blank_line_after_opening_tag' => false,
// override @Symonfy
'phpdoc_align' => false,
'phpdoc_separation' => false,
'yoda_style' => false,
'phpdoc_summary' => false,
'increment_style' => false,
'php_unit_fqcn_annotation' => false,
'array_syntax' => [
'syntax' => 'short'
],
'class_definition' => [
'single_line' => true
],
'comment_to_phpdoc' => true,
'concat_space' => [
'spacing' => 'one'
],
'declare_strict_types' => true,
'dir_constant' => true,
'is_null' => true,
'no_null_property_initialization' => true,
'no_superfluous_phpdoc_tags' => true,
'no_useless_return' => true,
'no_useless_else' => true,
'multiline_whitespace_before_semicolons' => true,
'mb_str_functions' => true,
'ordered_class_elements' => false,
'ordered_imports' => true,
'phpdoc_order_by_value' => true,
'php_unit_namespaced' => true,
'php_unit_construct' => true,
'phpdoc_add_missing_param_annotation' => [
'only_untyped' => true
],
'phpdoc_order' => true,
'phpdoc_var_annotation_correct_order' => true,
'strict_comparison' => true,
'strict_param' => true,
])
->setRiskyAllowed(true)
->setFinder($finder);