Skip to content

Commit

Permalink
Merge pull request #4601 from samsonasik/apply-rector-php73-feature-a…
Browse files Browse the repository at this point in the history
…lternative

[Rector] Apply Full PHP 7.3 Rector Set List (Skip JsonThrowOnErrorRector & StringifyStrNeedlesRector)
  • Loading branch information
samsonasik authored Apr 24, 2021
2 parents d6bb32f + c1c047a commit f66c545
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector;
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector;
use Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector;
use Rector\Set\ValueObject\SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Utils\Rector\PassStrictParameterToFunctionParameterRector;
use Utils\Rector\UnderscoreToCamelCaseVariableNameRector;
Expand All @@ -32,6 +34,10 @@
// paths to refactor; solid alternative to CLI arguments
$parameters->set(Option::PATHS, [__DIR__ . '/app', __DIR__ . '/system', __DIR__ . '/tests', __DIR__ . '/utils/Rector']);

$parameters->set(Option::SETS, [
SetList::PHP_73,
]);

// do you need to include constants, class aliases or custom autoloader? files listed will be executed
$parameters->set(Option::BOOTSTRAP_FILES, [
__DIR__ . '/system/Test/bootstrap.php',
Expand All @@ -45,6 +51,8 @@
__DIR__ . '/tests/system/Config/fixtures',
__DIR__ . '/tests/_support',
PassStrictParameterToFunctionParameterRector::class => [__DIR__ . '/tests/system/Database/Live/SelectTest.php'],
JsonThrowOnErrorRector::class,
StringifyStrNeedlesRector::class,
]);

// auto import fully qualified class names
Expand All @@ -61,7 +69,6 @@
$services->set(ForToForeachRector::class);
$services->set(ChangeNestedForeachIfsToEarlyContinueRector::class);
$services->set(ChangeIfElseValueAssignToEarlyReturnRector::class);
$services->set(ArrayKeyFirstLastRector::class);
$services->set(SimplifyStrposLowerRector::class);
$services->set(CombineIfRector::class);
$services->set(SimplifyIfReturnBoolRector::class);
Expand Down

0 comments on commit f66c545

Please sign in to comment.