-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
92 lines (87 loc) · 2.81 KB
/
.php-cs-fixer.dist.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
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
<?php
declare(strict_types=1);
use PhpCsFixer\Fixer\FunctionNotation\NativeFunctionInvocationFixer;
$header = <<<'COMMENT'
This file is part of the PIDIA.
(c) Carlos Chininin <cio@pidia.pe>
COMMENT;
$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude('var')
->exclude('config')
->exclude('vendor');
return (new PhpCsFixer\Config())
->setUsingCache(true)
->setRiskyAllowed(true)
->setFinder($finder)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHPUnit57Migration:risky' => true,
'array_syntax' => [
'syntax' => 'short',
],
'native_constant_invocation' => [
'fix_built_in' => false,
],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'escape_implicit_backslashes' => true,
'explicit_indirect_variable' => true,
'final_internal_class' => true,
'fopen_flags' => [
'b_mode' => true,
],
'header_comment' => [
'header' => $header,
'separate' => 'both',
],
'heredoc_to_nowdoc' => true,
'linebreak_after_opening_tag' => true,
'list_syntax' => [
'syntax' => 'short',
],
'mb_str_functions' => true,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'no_php4_constructor' => true,
'echo_tag_syntax' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => [
'order' => [
'use_trait',
'constant_public',
'constant_protected',
'constant_private',
'property_public',
'property_protected',
'property_private',
'construct',
'destruct',
'magic',
'phpunit',
'method_public',
'method_protected',
'method_private',
],
],
'ordered_imports' => true,
'php_unit_strict' => true,
'php_unit_no_expectation_annotation' => true,
'php_unit_test_class_requires_covers' => true,
'phpdoc_order' => true,
'phpdoc_summary' => false,
'psr_autoloading' => true,
'strict_comparison' => true,
'strict_param' => true,
'declare_strict_types' => true,
'native_function_invocation' => [
'include' => [NativeFunctionInvocationFixer::SET_COMPILER_OPTIMIZED],
'scope' => 'namespaced',
'strict' => false, // or remove this line, as false is default value
],
])
->setCacheFile(__DIR__.'/var/.php_cs.cache');