-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.php_cs.dist
59 lines (52 loc) · 1.42 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
<?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__)
)
;
/*
This document has been generated with
https://mlocati.github.io/php-cs-fixer-configurator/#configurator
you can change this configuration by importing this YAML code:
expandSets: false
fixerSets:
- '@Symfony'
fixers:
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
*/