2020-07-18 16:57:24 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-12-05 21:32:44 +00:00
|
|
|
use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector;
|
2020-12-01 13:52:24 +00:00
|
|
|
use Rector\Generic\Rector\ClassMethod\ArgumentAdderRector;
|
|
|
|
use Rector\Generic\ValueObject\ArgumentAdder;
|
2020-07-18 16:57:24 +00:00
|
|
|
use Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector;
|
|
|
|
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
|
2020-06-08 09:28:03 +00:00
|
|
|
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
|
2020-07-18 16:57:24 +00:00
|
|
|
use Rector\Php80\Rector\Class_\StringableForToStringRector;
|
2020-12-05 21:33:30 +00:00
|
|
|
use Rector\Php80\Rector\ClassMethod\FinalPrivateToPrivateVisibilityRector;
|
2020-12-05 22:16:54 +00:00
|
|
|
use Rector\Php80\Rector\ClassMethod\SetStateToStaticRector;
|
2020-07-18 16:57:24 +00:00
|
|
|
use Rector\Php80\Rector\FuncCall\ClassOnObjectRector;
|
|
|
|
use Rector\Php80\Rector\FuncCall\TokenGetAllToObjectRector;
|
|
|
|
use Rector\Php80\Rector\FunctionLike\UnionTypesRector;
|
|
|
|
use Rector\Php80\Rector\Identical\StrEndsWithRector;
|
|
|
|
use Rector\Php80\Rector\Identical\StrStartsWithRector;
|
|
|
|
use Rector\Php80\Rector\NotIdentical\StrContainsRector;
|
2020-06-22 18:18:58 +00:00
|
|
|
use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector;
|
2020-07-18 16:57:24 +00:00
|
|
|
use Rector\Php80\Rector\Ternary\GetDebugTypeRector;
|
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
2020-12-01 13:52:24 +00:00
|
|
|
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
2020-07-18 16:57:24 +00:00
|
|
|
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
|
|
$services = $containerConfigurator->services();
|
|
|
|
|
|
|
|
$services->set(UnionTypesRector::class);
|
|
|
|
|
|
|
|
$services->set(StrContainsRector::class);
|
|
|
|
|
|
|
|
$services->set(StrStartsWithRector::class);
|
|
|
|
|
|
|
|
$services->set(StrEndsWithRector::class);
|
|
|
|
|
|
|
|
$services->set(StringableForToStringRector::class);
|
|
|
|
|
|
|
|
$services->set(AnnotationToAttributeRector::class);
|
|
|
|
|
|
|
|
$services->set(ClassOnObjectRector::class);
|
|
|
|
|
|
|
|
$services->set(GetDebugTypeRector::class);
|
|
|
|
|
|
|
|
$services->set(TokenGetAllToObjectRector::class);
|
|
|
|
|
|
|
|
$services->set(RemoveUnusedVariableInCatchRector::class);
|
2020-06-08 09:28:03 +00:00
|
|
|
|
|
|
|
$services->set(ClassPropertyAssignToConstructorPromotionRector::class);
|
2020-06-22 18:18:58 +00:00
|
|
|
|
|
|
|
$services->set(ChangeSwitchToMatchRector::class);
|
2020-12-01 13:52:24 +00:00
|
|
|
|
|
|
|
// nette\utils and Strings::replace()
|
|
|
|
$services->set(ArgumentAdderRector::class)
|
|
|
|
->call('configure', [[
|
|
|
|
ArgumentAdderRector::ADDED_ARGUMENTS => ValueObjectInliner::inline([
|
|
|
|
new ArgumentAdder('Nette\Utils\Strings', 'replace', 2, 'replacement', ''),
|
|
|
|
]),
|
|
|
|
]]);
|
2020-12-05 20:38:33 +00:00
|
|
|
|
2020-12-05 21:32:44 +00:00
|
|
|
$services->set(RemoveParentCallWithoutParentRector::class);
|
2020-12-05 20:38:33 +00:00
|
|
|
$services->set(SetStateToStaticRector::class);
|
2020-12-05 21:33:30 +00:00
|
|
|
$services->set(FinalPrivateToPrivateVisibilityRector::class);
|
2020-07-18 16:57:24 +00:00
|
|
|
};
|