Skip to content

Commit b5e16e9

Browse files
committed
Add empty related rules
1 parent 9dd841d commit b5e16e9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Template/rector.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
66
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
7+
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
78
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
89
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
910
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
@@ -14,6 +15,7 @@
1415
use Rector\CodeQuality\Rector\If_\ShortenElseIfRector;
1516
use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector;
1617
use Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector;
18+
use Rector\CodeQuality\Rector\Ternary\TernaryEmptyArrayArrayDimFetchToCoalesceRector;
1719
use Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector;
1820
use Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector;
1921
use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
@@ -34,6 +36,8 @@
3436
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
3537
use Rector\Set\ValueObject\LevelSetList;
3638
use Rector\Set\ValueObject\SetList;
39+
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
40+
use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector;
3741
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
3842

3943
return static function (RectorConfig $rectorConfig): void {
@@ -110,6 +114,10 @@
110114
$rectorConfig->rule(FuncGetArgsToVariadicParamRector::class);
111115
$rectorConfig->rule(MakeInheritedMethodVisibilitySameAsParentRector::class);
112116
$rectorConfig->rule(SimplifyEmptyArrayCheckRector::class);
117+
$rectorConfig->rule(SimplifyEmptyCheckOnEmptyArrayRector::class);
118+
$rectorConfig->rule(TernaryEmptyArrayArrayDimFetchToCoalesceRector::class);
119+
$rectorConfig->rule(EmptyOnNullableObjectToInstanceOfRector::class);
120+
$rectorConfig->rule(DisallowedEmptyRuleFixerRector::class);
113121
$rectorConfig
114122
->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [
115123
/**

0 commit comments

Comments
 (0)