-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.php_cs
72 lines (72 loc) · 3.21 KB
/
.php_cs
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
<?php
$header = <<<'EOF'
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
This software consists of voluntary contributions made by many individuals
and is licensed under the MIT license.
Copyright (c) 2018 Yuuki Takezawa
EOF;
return PhpCsFixer\Config::create()
->setRiskyAllowed(false)
->setRules([
'@PSR2' => true,
'declare_strict_types' => true,
'declare_equal_normalize' => 'none',
'@PHP56Migration' => false,
'@Symfony' => true,
'@Symfony:risky' => false,
//'align_multiline_comment' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_before_statement' => true,
'braces' => [
'allow_single_line_closure' => false,
'position_after_anonymous_constructs' => 'same',
'position_after_control_structures' => 'same',
'position_after_functions_and_oop_constructs' => 'next'
],
'combine_consecutive_unsets' => true,
// one should use PHPUnit methods to set up expected exception instead of annotations
'general_phpdoc_annotation_remove' => ['expectedException', 'expectedExceptionMessage', 'expectedExceptionMessageRegExp'],
'header_comment' => ['header' => $header],
'heredoc_to_nowdoc' => true,
'list_syntax' => ['syntax' => 'long'],
'method_argument_space' => ['keep_multiple_spaces_after_comma' => true],
'no_extra_consecutive_blank_lines' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'],
//'no_null_property_initialization' => true,
'no_short_echo_tag' => true,
//'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
//'php_unit_strict' => true,
'php_unit_test_class_requires_covers' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'single_blank_line_at_eof' => true,
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
//'strict_comparison' => true,
//'strict_param' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'single_blank_line_before_namespace' => false,
'no_blank_lines_after_class_opening' => true,
'single_line_after_imports' => true,
'blank_line_after_opening_tag' => false,
])
->setRiskyAllowed(true)
->setFinder(
PhpCsFixer\Finder::create()
->exclude('tests')
->in(__DIR__)
);