-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php_cs
34 lines (30 loc) · 963 Bytes
/
.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
<?php
if (!class_exists('PhpCsFixer\Config', true)) {
fwrite(STDERR, "Your php-cs-version is outdated: please upgrade it.\n");
die(16);
}
$rules = [
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_after_opening_tag' => false,
'cast_spaces' => ['space' => 'single'],
'concat_space' => ['spacing' => 'one'],
'no_blank_lines_before_namespace' => true,
'phpdoc_align' => false,
'single_blank_line_before_namespace' => false,
'yoda_style' => false,
];
$fixerFactory = PhpCsFixer\FixerFactory::create()->registerBuiltInFixers();
foreach (array_keys($rules) as $ruleName) {
if ($ruleName[0] !== '@') {
if (!$fixerFactory->hasRule($ruleName)) {
unset($rules[$ruleName]);
}
}
}
return PhpCsFixer\Config::create()
->setCacheFile(__DIR__.'/.php_cs.cache')
->setRules($rules)
->setFinder(
PhpCsFixer\Finder::create()->in([__DIR__.'/src'])
);