-
Notifications
You must be signed in to change notification settings - Fork 103
/
.php_cs.dist
78 lines (72 loc) · 2.84 KB
/
.php_cs.dist
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
<?php
declare(strict_types=1);
$fileHeaderComment = <<<COMMENT
This file is part of the Explicit Architecture POC,
which is created on top of the Symfony Demo application.
(c) Herberto Graça <herberto.graca@gmail.com>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
COMMENT;
$finder = PhpCsFixer\Finder::create()
->in(['src', 'tests', 'lib', 'build/Migration', 'build/Fixture'])
->exclude('tests/_support/_generated')
->name('*.php')
;
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP71Migration:risky' => true,
'@PHPUnit75Migration:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'class_definition' => [
'multiLineExtendsEachSingleLine' => true,
],
'concat_space' => ['spacing' => 'one'],
'declare_strict_types' => true,
'final_internal_class' => false, // false because otherwise internal classes can not have subclasses
'fully_qualified_strict_types' => true,
'header_comment' => ['header' => $fileHeaderComment, 'separate' => 'both'],
'heredoc_indentation' => true,
'linebreak_after_opening_tag' => true,
'mb_str_functions' => true,
'native_function_invocation' => [],
'no_multiline_whitespace_before_semicolons' => true,
'no_php4_constructor' => true,
'no_short_echo_tag' => true,
'no_superfluous_phpdoc_tags' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => [
'sort_algorithm' => 'alpha',
'imports_order' => ['class', 'function', 'const'],
],
'php_unit_internal_class' => true,
'php_unit_method_casing' => ['case' => 'snake_case'],
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_size_class' => ['group' => 'small'],
'php_unit_strict' => false, // false because otherwise self::assertEquals => self::assertSame
'php_unit_test_annotation' => [
'style' => 'annotation',
],
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
'phpdoc_align' => false,
'phpdoc_order' => true,
'phpdoc_summary' => false,
'pre_increment' => false,
'return_type_declaration' => ['space_before' => 'none'],
'semicolon_after_instruction' => true,
'single_line_throw' => false,
'strict_comparison' => true,
'strict_param' => true,
'void_return' => true,
'yoda_style' => [
'equal' => false,
'identical' => false,
],
])
->setFinder($finder)
->setCacheFile(__DIR__.'/var/.php_cs.cache')
;