-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance code quality and allow symfony 7
* add rector * run rector * another rector run * fix phpstan errors * run ecs and allow symfony 7 * adjust docs * run ecs on contao folder, add ecs to ci * fix typo in ci
- Loading branch information
Showing
35 changed files
with
331 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use PhpCsFixer\Fixer\Basic\BracesPositionFixer; | ||
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer; | ||
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer; | ||
use PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer; | ||
use Symplify\EasyCodingStandard\Config\ECSConfig; | ||
|
||
return ECSConfig::configure() | ||
->withPaths([ | ||
__DIR__ . '/src', | ||
__DIR__ . '/contao', | ||
]) | ||
|
||
// add a single rule | ||
->withRules([ | ||
NoUnusedImportsFixer::class, | ||
BracesPositionFixer::class, | ||
]) | ||
|
||
// add sets - group of rules | ||
->withPreparedSets( | ||
arrays: true, | ||
comments: true, | ||
docblocks: true, | ||
spaces: true, | ||
namespaces: true, | ||
) | ||
->withPhpCsFixerSets(symfony: true) | ||
->withSkip([ | ||
NotOperatorWithSuccessorSpaceFixer::class, | ||
MethodChainingIndentationFixer::class => [ | ||
'*/DependencyInjection/Configuration.php', | ||
], | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Contao\Rector\Set\ContaoLevelSetList; | ||
use Contao\Rector\Set\ContaoSetList; | ||
use Rector\Config\RectorConfig; | ||
use Rector\Php84\Rector\Param\ExplicitNullableParamTypeRector; | ||
use Rector\Set\ValueObject\LevelSetList; | ||
use Rector\Symfony\Set\SymfonySetList; | ||
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector; | ||
|
||
return RectorConfig::configure() | ||
->withPaths([ | ||
__DIR__ . '/src', | ||
__DIR__ . '/contao', | ||
]) | ||
->withRules([ | ||
AddVoidReturnTypeWhereNoReturnRector::class, | ||
# In Vorbereitung für PHP 8.4: | ||
ExplicitNullableParamTypeRector::class | ||
]) | ||
|
||
->withImportNames(importShortClasses: false, removeUnusedImports: true) | ||
->withSets([ | ||
LevelSetList::UP_TO_PHP_81, | ||
SymfonySetList::SYMFONY_54, | ||
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION, | ||
# Erst mit Symfony 6 (Contao 5) nutzen: | ||
// SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES, | ||
ContaoLevelSetList::UP_TO_CONTAO_413, | ||
ContaoSetList::FQCN, | ||
ContaoSetList::ANNOTATIONS_TO_ATTRIBUTES, | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.