-
Notifications
You must be signed in to change notification settings - Fork 1
/
rules.php
54 lines (49 loc) · 2.02 KB
/
rules.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
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$finder = Finder::create()->in(getcwd());
return Config::create()
->setRules([
// psr1
'encoding' => true,
'full_opening_tag' => true,
// psr2
'braces' => true,
'elseif' => true,
'single_blank_line_at_eof' => true,
'no_spaces_after_function_name' => true,
'function_declaration' => true,
'indentation_type' => true,
'blank_line_after_namespace' => true,
'line_ending' => true,
'lowercase_constants' => true,
'lowercase_keywords' => true,
'method_argument_space' => true,
'single_import_per_statement' => true,
'no_spaces_inside_parenthesis' => true,
'no_closing_tag' => true,
'single_line_after_imports' => true,
'no_trailing_whitespace' => true,
'visibility_required' => true,
// other fixers
'concat_space' => ['spacing' => 'one'],
'no_extra_consecutive_blank_lines' => true,
'new_with_braces' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'object_operator_without_whitespace' => true,
'binary_operator_spaces' => [
'align_double_arrow' => true,
'align_equals' => false,
],
'self_accessor' => false,
'single_quote' => true,
'standardize_not_equals' => true,
'unary_operator_spaces' => true,
'no_unused_imports' => true,
'no_whitespace_in_blank_line' => true,
'phpdoc_order' => true,
])
->setFinder($finder)
->setUsingCache(true)
->setCacheFile(__DIR__ . '/.php_cs.cache');