|
1 | 1 | <?php
|
2 | 2 |
|
3 | 3 | /*
|
4 |
| - * This file is part of the Pattern Library Builder project. |
| 4 | + * This file is part of the Pattern Library Builder library. |
5 | 5 | *
|
6 | 6 | * Copyright (c) 2017-present LIN3S <[email protected]>
|
7 | 7 | *
|
8 | 8 | * For the full copyright and license information, please view the LICENSE
|
9 | 9 | * file that was distributed with this source code.
|
10 | 10 | */
|
11 | 11 |
|
12 |
| -use PhpCsFixer\Config; |
13 |
| -use PhpCsFixer\Finder; |
14 |
| -use PhpCsFixer\Fixer\Comment\HeaderCommentFixer; |
| 12 | +declare(strict_types=1); |
15 | 13 |
|
16 |
| -$header = <<<'EOF' |
17 |
| -This file is part of the Pattern Library Builder project. |
| 14 | +use LIN3S\PhpCsFixerConfig\Lin3sConfig; |
18 | 15 |
|
19 |
| -Copyright (c) 2017-present LIN3S <[email protected]> |
| 16 | +$config = new Lin3sConfig('Pattern Library Builder', '2017', 'library'); |
| 17 | +$config->getFinder()->in(__DIR__ . '/src'); |
20 | 18 |
|
21 |
| -For the full copyright and license information, please view the LICENSE |
22 |
| -file that was distributed with this source code. |
23 |
| -EOF; |
| 19 | +$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__; |
24 | 20 |
|
25 |
| -return Config::create() |
26 |
| - ->setRiskyAllowed(true) |
27 |
| - ->setFinder( |
28 |
| - Finder::create() |
29 |
| - ->in([ |
30 |
| - __DIR__ . '/src', |
31 |
| - __DIR__ . '/tests/Application/app', |
32 |
| - __DIR__ . '/tests/Application/bin', |
33 |
| - __DIR__ . '/tests/Application/web', |
34 |
| - ]) |
35 |
| - ) |
36 |
| - ->setRules([ |
37 |
| - '@Symfony' => true, |
38 |
| - '@Symfony:risky' => true, |
39 |
| - 'binary_operator_spaces' => [ |
40 |
| - 'align_double_arrow' => true, |
41 |
| - ], |
42 |
| - 'concat_space' => ['spacing' => 'one'], |
43 |
| - 'header_comment' => [ |
44 |
| - 'header' => $header, |
45 |
| - 'commentType' => HeaderCommentFixer::HEADER_COMMENT, |
46 |
| - ], |
47 |
| - 'no_unreachable_default_argument_value' => false, |
48 |
| - 'ordered_imports' => true, |
49 |
| - 'phpdoc_order' => true, |
50 |
| - 'phpdoc_annotation_without_dot' => false, |
51 |
| - 'strict_param' => true, |
52 |
| - ]); |
| 21 | +$config->setCacheFile($cacheDir . '/.php_cs.cache'); |
| 22 | + |
| 23 | +return $config; |
0 commit comments