Skip to content

Commit cd25b89

Browse files
author
plumthedev
committed
Update README usage section
1 parent 5fcfec2 commit cd25b89

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

readme.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,36 @@ Create a configuration file `.php_cs` in the root of your project:
1111

1212
```php
1313
<?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;
1423

1524
use plumthedev\PhpCsFixer\Config;
1625

1726
$csConfig = Config::create();
18-
$csConfigFinder = $csConfig->getFinder();
1927

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
2140
$csConfig->setFinder($csConfigFinder);
2241

2342
return $csConfig;
43+
2444
```
2545

2646
## Running the tests

0 commit comments

Comments
 (0)