|
2 | 2 |
|
3 | 3 | declare(strict_types=1); |
4 | 4 |
|
| 5 | +/* |
| 6 | + * This file is part of the "typo3_encore" Extension for TYPO3 CMS. |
| 7 | + * |
| 8 | + * For the full copyright and license information, please read the |
| 9 | + * LICENSE.txt file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
5 | 12 | use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer; |
6 | 13 | use PhpCsFixer\Fixer\Comment\HeaderCommentFixer; |
7 | 14 | use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer; |
8 | 15 | use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer; |
9 | 16 | use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer; |
10 | 17 | use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer; |
11 | | -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
12 | 18 | use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayOpenerAndCloserNewlineFixer; |
13 | 19 | use Symplify\CodingStandard\Fixer\ArrayNotation\StandaloneLineInMultilineArrayFixer; |
14 | 20 | use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer; |
15 | 21 | use Symplify\EasyCodingStandard\Config\ECSConfig; |
16 | | -use Symplify\EasyCodingStandard\ValueObject\Option; |
17 | 22 | use Symplify\EasyCodingStandard\ValueObject\Set\SetList; |
18 | 23 |
|
19 | 24 | return static function (ECSConfig $config): void { |
20 | | - |
21 | | - $header = <<<EOF |
| 25 | + $header = <<<CODE_SAMPLE |
22 | 26 | This file is part of the "typo3_encore" Extension for TYPO3 CMS. |
23 | 27 |
|
24 | 28 | For the full copyright and license information, please read the |
25 | 29 | LICENSE.txt file that was distributed with this source code. |
26 | | -EOF; |
| 30 | +CODE_SAMPLE; |
27 | 31 |
|
28 | 32 | $config->paths([ |
29 | | - __DIR__.'/Classes', |
30 | | - __DIR__.'/Configuration', |
31 | | - __DIR__.'/Tests', |
| 33 | + __DIR__ . '/Classes', |
| 34 | + __DIR__ . '/Configuration', |
| 35 | + __DIR__ . '/Tests', |
| 36 | + __DIR__ . '/rector.php', |
| 37 | + __DIR__ . '/ecs.php', |
| 38 | + __DIR__ . '/ext_localconf.php', |
| 39 | + ]); |
| 40 | + |
| 41 | + $config->skip([ |
| 42 | + DeclareStrictTypesFixer::class => [__DIR__ . '/ext_localconf.php'], |
| 43 | + HeaderCommentFixer::class => [__DIR__ . '/ext_localconf.php'], |
32 | 44 | ]); |
33 | 45 |
|
34 | 46 | $config->ruleWithConfiguration(ArraySyntaxFixer::class, [ |
35 | | - 'syntax' => 'short' |
| 47 | + 'syntax' => 'short', |
| 48 | + ]); |
| 49 | + $config->ruleWithConfiguration(HeaderCommentFixer::class, [ |
| 50 | + 'header' => $header, |
| 51 | + 'separate' => 'both', |
36 | 52 | ]); |
37 | | - $config->ruleWithConfiguration(HeaderCommentFixer::class, ['header' => $header, 'separate' => 'both']); |
38 | 53 |
|
39 | 54 | $config->rule(StandaloneLineInMultilineArrayFixer::class); |
40 | 55 | $config->rule(ArrayOpenerAndCloserNewlineFixer::class); |
|
47 | 62 | 'allow_mixed' => true, |
48 | 63 | ]); |
49 | 64 |
|
50 | | - $config->sets([ |
51 | | - SetList::PSR_12, |
52 | | - SetList::SYMPLIFY, |
53 | | - SetList::COMMON, |
54 | | - SetList::CLEAN_CODE |
55 | | - ]); |
| 65 | + $config->sets([SetList::PSR_12, SetList::SYMPLIFY, SetList::COMMON, SetList::CLEAN_CODE]); |
56 | 66 | $config->rule(DeclareStrictTypesFixer::class); |
57 | 67 | $config->rule(LineLengthFixer::class); |
58 | 68 | $config->rule(YodaStyleFixer::class); |
|
0 commit comments