-
-
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
51 lines (42 loc) · 1.18 KB
/
.php-cs-fixer.dist.php
File metadata and controls
51 lines (42 loc) · 1.18 KB
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
<?php
declare(strict_types=1);
$rules = [
'phpdoc_indent' => true,
'phpdoc_order' => [
'order' => ['param', 'return', 'throws'],
],
'phpdoc_separation' => true,
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_scalar' => true,
'phpdoc_types' => true,
'phpdoc_to_comment' => false,
'phpdoc_add_missing_param_annotation' => true,
];
$docheader = getcwd() . '/.docheader';
if (file_exists($docheader)) {
$header = file_get_contents($docheader);
$header = preg_replace(
['!^/\*\*\n!', '! \*/!', '! \* ?!', '!%year%!', '!' . date('Y-Y') . '!'],
[null, null, null, date('Y'), date('Y')],
$header
);
$header = trim($header);
$rules['header_comment'] = [
'header' => $header,
'comment_type' => 'PHPDoc',
'location' => 'after_declare_strict',
'separate' => 'both',
];
}
$finder = PhpCsFixer\Finder::create()
->in([getcwd()])
->exclude('public')
->exclude('resources')
->exclude('vendor')
->exclude('tmp')
;
return (new PhpCsFixer\Config())
->setRiskyAllowed(false)
->setFinder($finder)
->setRules($rules);