File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,36 @@ Create a configuration file `.php_cs` in the root of your project:
11
11
12
12
``` php
13
13
<?php
14
+ $projectHeader = <<<'HEADER'
15
+ Yii2 PHP CS Fixer Config
16
+
17
+ @author Kacper Pruszynski (plumthedev)
18
+ @link https://github.com/plumthedev/yii2-php-cs-fixer-config
19
+ @copyright Copyright (c) 2019 plumthedev
20
+ @license https://github.com/plumthedev/yii2-php-cs-fixer-config/blob/master/LICENSE
21
+ @version 1.0.1
22
+ HEADER;
14
23
15
24
use plumthedev\PhpCsFixer\Config;
16
25
17
26
$csConfig = Config::create();
18
- $csConfigFinder = $csConfig->getFinder();
19
27
20
- $csConfigFinder->in(__DIR__); // set finder root directory
28
+ // CS Config setup
29
+ $csConfig->mergeRules([
30
+ 'header_comment' => [
31
+ 'header' => $projectHeader,
32
+ 'commentType' => 'PHPDoc',
33
+ 'separate' => 'bottom',
34
+ ]
35
+ ]);
36
+
37
+ // CS Finder setup
38
+ $csConfigFinder = $csConfig->getFinder();
39
+ $csConfigFinder->in(__DIR__); // set current project directory
21
40
$csConfig->setFinder($csConfigFinder);
22
41
23
42
return $csConfig;
43
+
24
44
```
25
45
26
46
## Running the tests
You can’t perform that action at this time.
0 commit comments