-
Notifications
You must be signed in to change notification settings - Fork 41
/
.php-cs-fixer.dist.php
60 lines (54 loc) · 1.54 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
56
57
58
59
60
<?php
declare(strict_types=1);
$header = <<<EOF
This file is part of the Happyr Doctrine Specification package.
(c) Tobias Nyholm <[email protected]>
Kacper Gunia <[email protected]>
Peter Gribanov <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;
$rules = [
'@PSR2' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PHP70Migration' => true,
'@PHP70Migration:risky' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => $header,
],
'array_syntax' => ['syntax' => 'short'],
'no_superfluous_phpdoc_tags' => false,
'single_line_throw' => false,
'blank_line_after_opening_tag' => false,
'ordered_imports' => [
'sort_algorithm' => 'alpha',
],
'phpdoc_align' => [
'tags' => ['param', 'return', 'throws', 'type', 'var'],
],
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
'sort_algorithm' => 'none',
],
'native_constant_invocation' => false,
'native_function_invocation' => false,
'ordered_class_elements' => false,
'operator_linebreak' => [
'position' => 'end',
],
];
$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
->notPath('bootstrap.php')
;
return (new PhpCsFixer\Config())
->setRules($rules)
->setFinder($finder)
->setRiskyAllowed(true)
->setUsingCache(true)
;