/
.php_cs.dist.php
70 lines (66 loc) · 2.97 KB
/
.php_cs.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
<?php
/**
* This file is part of the bugloos/circuit-breaker-bundle project.
* (c) Bugloos <https://bugloos.com/>
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
$header = <<<'EOF'
This file is part of the bugloos/circuit-breaker-bundle project.
(c) Bugloos <https://bugloos.com/>
For the full copyright and license information, please view
the LICENSE file that was distributed with this source code.
EOF;
if (!file_exists(__DIR__.'/src')) {
exit(0);
}
return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'@PhpCsFixer' => true,
'@PHP80Migration' => true,
'@Symfony:risky' => true,
'@DoctrineAnnotation' => true,
'@PHPUnit75Migration:risky' => true,
'php_unit_dedicate_assert' => ['target' => '5.6'],
'array_syntax' => ['syntax' => 'short'],
'fopen_flags' => false,
'protected_to_private' => false,
'native_constant_invocation' => true,
'combine_nested_dirname' => true,
'list_syntax' => ['syntax' => 'short'],
'visibility_required' => ['elements' => ['property', 'method', 'const']],
'ternary_to_null_coalescing' => true,
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
'no_superfluous_phpdoc_tags' => false,
'header_comment' => ['header' => $header, 'comment_type' => 'PHPDoc'],
])
->setRiskyAllowed(true)
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->append([__FILE__])
->notPath('#/Fixtures/#')
->exclude([
// directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code
// fixture templates
'Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom',
// resource templates
'Symfony/Bundle/FrameworkBundle/Resources/views/Form',
// explicit trigger_error tests
'Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/',
])
// Support for older PHPunit version
->notPath('Symfony/Bridge/PhpUnit/SymfonyTestsListener.php')
->notPath('#Symfony/Bridge/PhpUnit/.*Mock\.php#')
->notPath('#Symfony/Bridge/PhpUnit/.*Legacy#')
// file content autogenerated by `var_export`
->notPath('Symfony/Component/Translation/Tests/fixtures/resources.php')
// file content autogenerated by `VarExporter::export`
->notPath('Symfony/Component/Serializer/Tests/Fixtures/serializer.class.metadata.php')
// test template
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
// explicit trigger_error tests
->notPath('Symfony/Component/ErrorHandler/Tests/DebugClassLoaderTest.php')
)
;