-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php_cs.dist
44 lines (40 loc) · 1.25 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
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('tests/Fixtures')
->exclude('var')
->exclude('vendor')
->in(__DIR__)
->append([
__DIR__.'/dev-tools/doc.php',
__DIR__.'/php-cs-fixer',
])
;
$config = (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PHPUnit75Migration:risky' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@DoctrineAnnotation' => true,
'list_syntax' => ['syntax' => 'long'],
'no_superfluous_phpdoc_tags' => false,
'single_line_comment_style' => false,
])
->setFinder($finder)
;
// special handling of fabbot.io service if it's using too old PHP CS Fixer version
if (false !== getenv('FABBOT_IO')) {
try {
PhpCsFixer\FixerFactory::create()
->registerBuiltInFixers()
->registerCustomFixers($config->getCustomFixers())
->useRuleSet(new PhpCsFixer\RuleSet($config->getRules()));
} catch (PhpCsFixer\ConfigurationException\InvalidConfigurationException $e) {
$config->setRules([]);
} catch (UnexpectedValueException $e) {
$config->setRules([]);
} catch (InvalidArgumentException $e) {
$config->setRules([]);
}
}
return $config;