Skip to content

Commit c13adca

Browse files
author
plumthedev
committed
update readme
1 parent 433a186 commit c13adca

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

readme.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Yii2 PHP CS Fixer Config
2-
PHP CS Fixer config for Yii2 projects. The ruleset is [grab from Yii 2 ecosystem](https://github.com/yiisoft/yii2/blob/master/cs/src/YiiConfig.php).
2+
![Packagist downloads](https://img.shields.io/packagist/dt/plumthedev/yii2-php-cs-fixer-config?color=%238e44ad)
3+
![GitHub license](https://img.shields.io/github/license/plumthedev/yii2-php-cs-fixer-config?color=%238e44ad)
4+
![GitHub stars](https://img.shields.io/github/stars/plumthedev/yii2-php-cs-fixer-config?color=%238e44ad)
5+
6+
PHP CS Fixer config for Yii2 projects. Contains [Config](src/Config.php) and [Finder](src/Finder.php) which excludes by default Yii2 app basic and advanced directories.
7+
The ruleset is [grab from Yii 2 ecosystem](https://github.com/yiisoft/yii2/blob/master/cs/src/YiiConfig.php) and is automatically updated with it.
38

49
## Installation
510
```shell script
@@ -11,14 +16,19 @@ Create a configuration file `.php_cs` in the root of your project:
1116

1217
```php
1318
<?php
14-
$projectHeader = <<<'HEADER'
19+
$composerJsonPath = __DIR__ . '/composer.json';
20+
$composerJson = file_get_contents($composerJsonPath);
21+
$composerProject = json_decode($composerJson);
22+
$currentYear = date('Y');
23+
24+
$projectHeader = <<<HEADER
1525
Yii2 PHP CS Fixer Config
1626

1727
@author Kacper Pruszynski (plumthedev)
1828
@link https://github.com/plumthedev/yii2-php-cs-fixer-config
19-
@copyright Copyright (c) 2019 plumthedev
29+
@copyright Copyright (c) 2019 - {$currentYear} plumthedev
2030
@license https://github.com/plumthedev/yii2-php-cs-fixer-config/blob/master/LICENSE
21-
@version 1.0.1
31+
@version {$composerProject->version}
2232
HEADER;
2333

2434
use plumthedev\PhpCsFixer\Config;
@@ -53,7 +63,7 @@ $ composer unit-tests
5363

5464
PHP CS Fixer
5565

56-
```
66+
```shell script
5767
$ composer cs-fix
5868
```
5969

0 commit comments

Comments
 (0)