-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.php-cs-fixer.dist.php
More file actions
39 lines (32 loc) · 921 Bytes
/
.php-cs-fixer.dist.php
File metadata and controls
39 lines (32 loc) · 921 Bytes
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
<?php
$header = <<<EOF
This file is part of {{name}}
{{description}}
For the full copyright and license information, please view the LICENSE.txt
file that was distributed with this source code.
EOF;
$info = json_decode(file_get_contents(__DIR__ . '/composer.json'), true);
$header = trim(str_replace(
['{{name}}', '{{description}}' ],
[$info['name'], $info['description'] ?? null],
$header
));
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/bin',
__DIR__ . '/src',
__DIR__ . '/tests'
]);
return (new PhpCsFixer\Config())
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setFinder($finder)
->setRules([
'@PER-CS' => true,
'php_unit_attributes' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => $header,
'location' => 'after_open',
'separate' => 'both',
]
]);