Skip to content

Commit 8912d89

Browse files
committed
TASK: Apply ecs for more files
1 parent dba320d commit 8912d89

File tree

3 files changed

+37
-30
lines changed

3 files changed

+37
-30
lines changed

ecs.php

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,54 @@
22

33
declare(strict_types=1);
44

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+
512
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
613
use PhpCsFixer\Fixer\Comment\HeaderCommentFixer;
714
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer;
815
use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer;
916
use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer;
1017
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
11-
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
1218
use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayOpenerAndCloserNewlineFixer;
1319
use Symplify\CodingStandard\Fixer\ArrayNotation\StandaloneLineInMultilineArrayFixer;
1420
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
1521
use Symplify\EasyCodingStandard\Config\ECSConfig;
16-
use Symplify\EasyCodingStandard\ValueObject\Option;
1722
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
1823

1924
return static function (ECSConfig $config): void {
20-
21-
$header = <<<EOF
25+
$header = <<<CODE_SAMPLE
2226
This file is part of the "typo3_encore" Extension for TYPO3 CMS.
2327
2428
For the full copyright and license information, please read the
2529
LICENSE.txt file that was distributed with this source code.
26-
EOF;
30+
CODE_SAMPLE;
2731

2832
$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'],
3244
]);
3345

3446
$config->ruleWithConfiguration(ArraySyntaxFixer::class, [
35-
'syntax' => 'short'
47+
'syntax' => 'short',
48+
]);
49+
$config->ruleWithConfiguration(HeaderCommentFixer::class, [
50+
'header' => $header,
51+
'separate' => 'both',
3652
]);
37-
$config->ruleWithConfiguration(HeaderCommentFixer::class, ['header' => $header, 'separate' => 'both']);
3853

3954
$config->rule(StandaloneLineInMultilineArrayFixer::class);
4055
$config->rule(ArrayOpenerAndCloserNewlineFixer::class);
@@ -47,12 +62,7 @@
4762
'allow_mixed' => true,
4863
]);
4964

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]);
5666
$config->rule(DeclareStrictTypesFixer::class);
5767
$config->rule(LineLengthFixer::class);
5868
$config->rule(YodaStyleFixer::class);

ext_localconf.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
<?php
22

33
call_user_func(static function ($packageKey) {
4-
54
$GLOBALS['TYPO3_CONF_VARS']['FE']['addAllowedPaths'] .= ',' . $packageKey;
65

76
// Enable for Frontend and Backend at the same time
87
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-preProcess'][$packageKey] = \Ssch\Typo3Encore\Integration\PageRendererHooks::class . '->renderPreProcess';
98
// Add collected assets to page cache
10-
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'][$packageKey] = \Ssch\Typo3Encore\Integration\TypoScriptFrontendControllerHooks::class . '->contentPostProcAll';
9+
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'][$packageKey] = \Ssch\Typo3Encore\Integration\TypoScriptFrontendControllerHooks::class . '->contentPostProcAll';
1110
}, 'typo3_encore');
1211

1312
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\Ssch\Typo3Encore\Form\FormDataProvider\RichtextEncoreConfiguration::class] = [
14-
'depends' => [
15-
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaText::class,
16-
],
13+
'depends' => [\TYPO3\CMS\Backend\Form\FormDataProvider\TcaText::class],
1714
];

rector.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
declare(strict_types=1);
44

5-
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
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+
612
use Rector\Config\RectorConfig;
713
use Rector\Set\ValueObject\LevelSetList;
814

915
return static function (RectorConfig $rectorConfig): void {
10-
$rectorConfig->paths([
11-
__DIR__.'/Classes',
12-
__DIR__.'/Configuration',
13-
__DIR__.'/Tests',
14-
]);
16+
$rectorConfig->paths([__DIR__ . '/Classes', __DIR__ . '/Configuration', __DIR__ . '/Tests']);
1517

1618
// define sets of rules
17-
$rectorConfig->sets([
18-
LevelSetList::UP_TO_PHP_74,
19-
]);
19+
$rectorConfig->sets([LevelSetList::UP_TO_PHP_74]);
2020
};

0 commit comments

Comments
 (0)