@@ -13,34 +13,47 @@ So, it's some work around till baseline will be implemented in the PHP CS Fixer.
1313
1414### Installation
1515
16- 1 . Require package by composer:
17- ``` shell
18- composer require --dev aeliot/php-cs-fixer-baseline
19- ```
20- 2. Extract ` Finder` from the config of PHP CS Fixer to the separate file.
16+ Download PHAR directly to root directory of the project or in another place as you wish.
17+ ``` shell
18+ curl -O https://github.com/Aeliot-Tm/php-cs-fixer-baseline/releases/download/v1.2.0/pcsf-baseline.phar
19+ ```
20+
21+ Or require package by composer:
22+ ``` shell
23+ composer require --dev aeliot/php-cs-fixer-baseline
24+ ```
25+
26+ ### Configuration
27+
28+ 1 . Extract ` Finder ` from the config of PHP CS Fixer to the separate file.
2129 It expects ` .php-cs-fixer-finder.php ` at the root of the project.
22- 3 . Add filtering of files detected by Finder
30+ 2 . Add filtering of files detected by Finder.
2331 ``` php
2432 use Aeliot\PhpCsFixerBaseline\Service\FilterFactory;
2533
2634 $finder->filter((new FilterFactory())->createFilter(__DIR__ . '/.php-cs-fixer-baseline.json', $config));
2735 ```
28- 4. Generate baseline. Just call script without options when all config files uses default names.
29- ` ` ` shell
30- vendor/bin/pcsf-baseline
36+ 3 . Autoload classes from PHAR (optional).
37+ If you use this project as PHAR file, you need to require autoloader of it to use provided filter.
38+ Do it in the main config file of PHP CS Fixer (` .php-cs-fixer.dist.php ` )
39+ ``` php
40+ Phar::loadPhar('/path/to/pcsf-baseline.phar', 'pcsf-baseline.phar');
41+ require_once 'phar://pcsf-baseline.phar/vendor/autoload.php';
3142 ```
32- See options of it below.
3343
34- You can see how it is configured in this project.
44+ ### Using
45+ 1 . Generate baseline. Just call script without options when all config files uses default names.
46+ - Call PHAR
47+ ``` shell
48+ php pcsf-baseline.phar
49+ ```
50+ - Or call script installed via Composer:
51+ ` ` ` shell
52+ vendor/bin/pcsf-baseline
53+ ` ` `
54+ See options of it below. You can see how it is configured in this project.
55+ 2. Use PHP CS Fixer as usual. All files mentioned in the baseline will be scip till they are not changed.
3556
36- # ## Autoload classes from PHAR
37-
38- If you use this project as PHAR file, you need to require autoloader of it to use provided filter.
39- Do it in the main config file of PHP CS Fixer (` .php-cs-fixer.dist.php` )
40- ` ` ` php
41- Phar::loadPhar(' /path/to/pcsf-baseline.phar' , ' pcsf-baseline.phar' );
42- require_once ' phar://pcsf-baseline.phar/vendor/autoload.php' ;
43- ` ` `
4457
4558# ## Options of baseline generator
4659
0 commit comments