-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy path.php-cs-fixer.php
More file actions
59 lines (55 loc) · 2.06 KB
/
.php-cs-fixer.php
File metadata and controls
59 lines (55 loc) · 2.06 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
<?php
$finder = ( new PhpCsFixer\Finder() )->in( __DIR__ );
$rules = array(
// Keep these rules for sure.
'phpdoc_order' => array(
'order' => array( 'since', 'param', 'throws', 'return' ),
),
'phpdoc_scalar' => true,
'phpdoc_trim' => true,
'phpdoc_var_without_name' => true,
'phpdoc_separation' => true,
'phpdoc_indent' => true,
'align_multiline_comment' => true,
'short_scalar_cast' => true,
'standardize_not_equals' => true,
'echo_tag_syntax' => true,
'semicolon_after_instruction' => true,
'no_useless_else' => true,
'no_superfluous_elseif' => true,
'elseif' => true,
'no_extra_blank_lines' => true,
'no_trailing_whitespace' => true,
'no_whitespace_in_blank_line' => true,
'ternary_to_null_coalescing' => true,
'no_null_property_initialization' => true,
'return_assignment' => true,
'blank_line_before_statement' => array(
'statements' => array(
'try',
'for',
'if',
'foreach',
'while',
),
),
'phpdoc_types_order' => array(
'null_adjustment' => 'always_last',
),
PhpCsFixerCustomFixers\Fixer\PhpUnitAssertArgumentsOrderFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\PhpUnitDedicatedAssertFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoUselessStrlenFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoUselessParenthesisFixer::name() => true,
);
$config = new PhpCsFixer\Config();
$config->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers());
$config->setRules( $rules );
return $config->setFinder( $finder );
// Maybe include these.
// 'phpdoc_summary' => true,
// 'phpdoc_align' => true,
// 'visibility_required' => true,
// 'multiline_comment_opening_closing' => true,
// 'phpdoc_types_order' => true,
// 'return_assignment' => true,
// 'static_lambda' => true,