2021-02-01 09:12:41 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
|
|
|
|
use PhpCsFixer\Fixer\ArrayNotation\TrailingCommaInMultilineArrayFixer;
|
|
|
|
use PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer;
|
2021-02-01 14:14:05 +01:00
|
|
|
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
|
2021-02-01 09:12:41 +01:00
|
|
|
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer;
|
|
|
|
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
|
|
|
|
use PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer;
|
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
use Symplify\EasyCodingStandard\ValueObject\Option;
|
|
|
|
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
|
|
|
|
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
|
|
$parameters = $containerConfigurator->parameters();
|
|
|
|
$services = $containerConfigurator->services();
|
|
|
|
|
|
|
|
$parameters->set(Option::PATHS, [
|
2021-02-01 14:14:05 +01:00
|
|
|
__DIR__ . '/Classes/',
|
|
|
|
__DIR__ . '/Configuration/',
|
|
|
|
__DIR__ . '/Tests/',
|
2021-02-01 09:12:41 +01:00
|
|
|
__DIR__ . '/ecs.php',
|
|
|
|
__DIR__ . '/ext_emconf.php',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$parameters->set(Option::SETS, [
|
|
|
|
SetList::PSR_12,
|
|
|
|
SetList::PHP_70,
|
|
|
|
SetList::PHP_73_MIGRATION,
|
|
|
|
SetList::PHPUNIT,
|
|
|
|
]);
|
|
|
|
|
|
|
|
$parameters->set(Option::SKIP, [
|
|
|
|
DeclareStrictTypesFixer::class => [
|
2021-02-01 14:14:05 +01:00
|
|
|
__DIR__ . '/Configuration/',
|
2021-02-01 09:12:41 +01:00
|
|
|
__DIR__ . '/ext_emconf.php',
|
|
|
|
],
|
|
|
|
]);
|
|
|
|
|
2021-02-01 14:14:05 +01:00
|
|
|
$services->set(NoUnusedImportsFixer::class);
|
2021-02-01 09:12:41 +01:00
|
|
|
$services->set(FullyQualifiedStrictTypesFixer::class);
|
|
|
|
$services->set(ArraySyntaxFixer::class)->call('configure', [[
|
|
|
|
'syntax' => 'short',
|
|
|
|
]]);
|
|
|
|
$services->set(SingleQuoteFixer::class);
|
|
|
|
$services->set(TrailingCommaInMultilineArrayFixer::class);
|
2021-02-01 14:14:05 +01:00
|
|
|
|
|
|
|
$services->set(PhpUnitTestAnnotationFixer::class)->call('configure', [[
|
|
|
|
'style' => 'annotation',
|
|
|
|
]]);
|
2021-02-01 09:12:41 +01:00
|
|
|
};
|