-
Notifications
You must be signed in to change notification settings - Fork 14
/
.php-cs-fixer.dist.php
55 lines (53 loc) · 2.06 KB
/
.php-cs-fixer.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
<?php
if (!file_exists(__DIR__.'/src')) {
exit(0);
}
return (new PhpCsFixer\Config())
->setRules(
[
'@PHP71Migration' => true,
'@PHPUnit75Migration:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'protected_to_private' => false,
]
)
->setRiskyAllowed(true)
->setFinder(
(new PhpCsFixer\Finder())
->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'
)
)
->setCacheFile('.php-cs-fixer.cache');