forked from rectorphp/rector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
early-return.php
31 lines (28 loc) · 1.7 KB
/
early-return.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
declare(strict_types=1);
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
use Rector\EarlyReturn\Rector\Foreach_\ReturnAfterToEarlyOnBreakRector;
use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector;
use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector;
use Rector\EarlyReturn\Rector\If_\ChangeNestedIfsToEarlyReturnRector;
use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector;
use Rector\EarlyReturn\Rector\If_\ChangeOrIfReturnToEarlyReturnRector;
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector;
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryAndToEarlyReturnRector;
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(ChangeNestedForeachIfsToEarlyContinueRector::class);
$services->set(ChangeAndIfToEarlyReturnRector::class);
$services->set(ChangeIfElseValueAssignToEarlyReturnRector::class);
$services->set(ChangeNestedIfsToEarlyReturnRector::class);
$services->set(RemoveAlwaysElseRector::class);
$services->set(ReturnBinaryAndToEarlyReturnRector::class);
$services->set(ChangeOrIfReturnToEarlyReturnRector::class);
$services->set(ChangeOrIfContinueToMultiContinueRector::class);
$services->set(ReturnAfterToEarlyOnBreakRector::class);
$services->set(PreparedValueToEarlyReturnRector::class);
$services->set(ReturnBinaryOrToEarlyReturnRector::class);
};