rector/config/set/php80.php

64 lines
2.4 KiB
PHP
Raw Normal View History

2020-07-18 16:57:24 +00:00
<?php
declare(strict_types=1);
use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector;
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;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
2020-07-18 16:57:24 +00:00
use Rector\Php80\Rector\Class_\StringableForToStringRector;
use Rector\Php80\Rector\ClassMethod\FinalPrivateToPrivateVisibilityRector;
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;
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;
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);
$services->set(ClassPropertyAssignToConstructorPromotionRector::class);
$services->set(ChangeSwitchToMatchRector::class);
// nette\utils and Strings::replace()
$services->set(ArgumentAdderRector::class)
->call('configure', [[
ArgumentAdderRector::ADDED_ARGUMENTS => ValueObjectInliner::inline([
new ArgumentAdder('Nette\Utils\Strings', 'replace', 2, 'replacement', ''),
]),
]]);
$services->set(RemoveParentCallWithoutParentRector::class);
$services->set(SetStateToStaticRector::class);
$services->set(FinalPrivateToPrivateVisibilityRector::class);
2020-07-18 16:57:24 +00:00
};