Skip to content

Commit d835235

Browse files
authored
Merge pull request #118 from kenjis/update-rector.php
Update rector.php
2 parents f59886e + c63cb28 commit d835235

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

rector.php

Lines changed: 11 additions & 1 deletion
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 {
@@ -109,10 +113,16 @@
109113
$rectorConfig->rule(FuncGetArgsToVariadicParamRector::class);
110114
$rectorConfig->rule(MakeInheritedMethodVisibilitySameAsParentRector::class);
111115
$rectorConfig->rule(SimplifyEmptyArrayCheckRector::class);
116+
$rectorConfig->rule(SimplifyEmptyCheckOnEmptyArrayRector::class);
117+
$rectorConfig->rule(TernaryEmptyArrayArrayDimFetchToCoalesceRector::class);
118+
$rectorConfig->rule(EmptyOnNullableObjectToInstanceOfRector::class);
119+
$rectorConfig->rule(DisallowedEmptyRuleFixerRector::class);
112120
$rectorConfig
113121
->ruleWithConfiguration(TypedPropertyFromAssignsRector::class, [
114122
/**
115-
* The INLINE_PUBLIC value is default to false to avoid BC break, if you use for libraries and want to preserve BC break, you don't need to configure it, as it included in LevelSetList::UP_TO_PHP_74
123+
* The INLINE_PUBLIC value is default to false to avoid BC break,
124+
* if you use for libraries and want to preserve BC break, you don't
125+
* need to configure it, as it included in LevelSetList::UP_TO_PHP_74
116126
* Set to true for projects that allow BC break
117127
*/
118128
TypedPropertyFromAssignsRector::INLINE_PUBLIC => true,

src/Template/rector.php

Lines changed: 11 additions & 1 deletion
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,10 +114,16 @@
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
/**
116-
* The INLINE_PUBLIC value is default to false to avoid BC break, if you use for libraries and want to preserve BC break, you don't need to configure it, as it included in LevelSetList::UP_TO_PHP_74
124+
* The INLINE_PUBLIC value is default to false to avoid BC break,
125+
* if you use for libraries and want to preserve BC break, you don't
126+
* need to configure it, as it included in LevelSetList::UP_TO_PHP_74
117127
* Set to true for projects that allow BC break
118128
*/
119129
TypedPropertyFromAssignsRector::INLINE_PUBLIC => true,

0 commit comments

Comments
 (0)