Skip to content

Commit

Permalink
Remove buggy rules that depend on false condition of all class and ca…
Browse files Browse the repository at this point in the history
…lls analysis, to improve static reflection (#5958)

Co-authored-by: kaizen-ci <[email protected]>
  • Loading branch information
TomasVotruba and kaizen-ci authored Mar 23, 2021
1 parent c13d234 commit 27e9ad0
Show file tree
Hide file tree
Showing 130 changed files with 3,746 additions and 11,907 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ It supports all versions of PHP from 5.3 and major open-source projects:
<p align="center">
<img src="/docs/images/php.png">
<img src="/docs/images/space.png" width=30>
<img src="/docs/images/phpunit.png">
<a href="https://github.com/rectorphp/rector-phpunit"><img src="/docs/images/phpunit.png"></a>
<img src="/docs/images/space.png" width=30>
<img src="/docs/images/symfony.png">
<a href="https://github.com/rectorphp/rector-symfony"><img src="/docs/images/symfony.png"></a>
<img src="/docs/images/space.png" width=30>
<a href="https://github.com/palantirnet/drupal-rector">
<img src="/docs/images/drupal.png" alt="Drupal Rector rules">
</a>
<br>
<img src="/docs/images/space.png" height=15>
<br>
<img src="/docs/images/cakephp.png">
<a href="https://github.com/rectorphp/rector-cakephp"><img src="/docs/images/cakephp.png"></a>
<img src="/docs/images/space.png" width=30>
<a href="https://github.com/sabbelasichon/typo3-rector">
<img src="/docs/images/typo3.png">
Expand All @@ -64,7 +64,7 @@ It supports all versions of PHP from 5.3 and major open-source projects:

## Documentation

- [Explore 660+ Rector Rules](/docs/rector_rules_overview.md)
- [Explore 450+ Rector Rules](/docs/rector_rules_overview.md)
- [How Does Rector Work?](/docs/how_it_works.md)
- [PHP Parser Nodes](https://github.com/rectorphp/php-parser-nodes-docs/)

Expand Down
8 changes: 1 addition & 7 deletions config/set/dead-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
use Rector\DeadCode\Rector\BinaryOp\RemoveDuplicatedInstanceOfRector;
use Rector\DeadCode\Rector\BooleanAnd\RemoveAndTrueRector;
use Rector\DeadCode\Rector\Cast\RecastingRemovalRector;
use Rector\DeadCode\Rector\ClassConst\RemoveUnusedClassConstantRector;
use Rector\DeadCode\Rector\ClassConst\RemoveUnusedPrivateConstantRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveDeadConstructorRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveDeadRecursiveClassMethodRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveDelegatingParentCallRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector;
Expand All @@ -26,7 +24,6 @@
use Rector\DeadCode\Rector\For_\RemoveDeadIfForeachForRector;
use Rector\DeadCode\Rector\For_\RemoveDeadLoopRector;
use Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector;
use Rector\DeadCode\Rector\Function_\RemoveUnusedFunctionRector;
use Rector\DeadCode\Rector\FunctionLike\RemoveCodeAfterReturnRector;
use Rector\DeadCode\Rector\FunctionLike\RemoveDeadReturnRector;
use Rector\DeadCode\Rector\FunctionLike\RemoveDuplicatedIfReturnRector;
Expand Down Expand Up @@ -61,10 +58,10 @@
$services->set(RemoveUnusedForeachKeyRector::class);
$services->set(RemoveParentCallWithoutParentRector::class);
$services->set(RemoveEmptyClassMethodRector::class);
$services->set(RemoveUnusedPrivatePropertyRector::class);
$services->set(RemoveDoubleAssignRector::class);
$services->set(SimplifyMirrorAssignRector::class);
$services->set(RemoveOverriddenValuesRector::class);
$services->set(RemoveUnusedPrivatePropertyRector::class);
$services->set(RemoveUnusedPrivateConstantRector::class);
$services->set(RemoveUnusedPrivateMethodRector::class);
$services->set(RemoveCodeAfterReturnRector::class);
Expand All @@ -85,13 +82,10 @@
$services->set(TernaryToBooleanOrFalseToBooleanAndRector::class);
$services->set(RemoveEmptyTestMethodRector::class);
$services->set(RemoveDeadTryCatchRector::class);
$services->set(RemoveUnusedClassConstantRector::class);
$services->set(RemoveUnusedVariableAssignRector::class);
$services->set(RemoveDuplicatedIfReturnRector::class);
$services->set(RemoveUnusedFunctionRector::class);
$services->set(RemoveUnusedNonEmptyArrayBeforeForeachRector::class);
$services->set(RemoveAssignOfVoidReturnFunctionRector::class);
$services->set(RemoveDeadRecursiveClassMethodRector::class);
$services->set(RemoveEmptyMethodCallRector::class);
$services->set(RemoveDeadConditionAboveReturnRector::class);
$services->set(RemoveUnusedConstructorParamRector::class);
Expand Down
12 changes: 3 additions & 9 deletions config/set/privatization.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
use Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector;
use Rector\Privatization\Rector\Class_\MakeUnusedClassesWithChildrenAbstractRector;
use Rector\Privatization\Rector\Class_\RepeatedLiteralToClassConstantRector;
use Rector\Privatization\Rector\ClassConst\PrivatizeLocalClassConstantRector;
use Rector\Privatization\Rector\ClassMethod\ChangeGlobalVariablesToPropertiesRector;
use Rector\Privatization\Rector\ClassMethod\MakeOnlyUsedByChildrenProtectedRector;
use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector;
use Rector\Privatization\Rector\ClassMethod\PrivatizeLocalOnlyMethodRector;
use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector;
use Rector\Privatization\Rector\Property\ChangeReadOnlyPropertyWithDefaultValueToConstantRector;
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
Expand All @@ -27,14 +24,11 @@
$services->set(ChangeReadOnlyPropertyWithDefaultValueToConstantRector::class);
$services->set(ChangeReadOnlyVariableWithDefaultValueToConstantRector::class);
$services->set(RepeatedLiteralToClassConstantRector::class);

// $services->set(ChangeLocalPropertyToVariableRector::class);

$services->set(PrivatizeLocalOnlyMethodRector::class);
$services->set(PrivatizeLocalGetterToPropertyRector::class);
$services->set(PrivatizeLocalPropertyToPrivatePropertyRector::class);
$services->set(PrivatizeLocalClassConstantRector::class);
$services->set(PrivatizeFinalClassPropertyRector::class);
$services->set(PrivatizeFinalClassMethodRector::class);
$services->set(MakeOnlyUsedByChildrenProtectedRector::class);

// buggy, requires more work
// $services->set(ChangeLocalPropertyToVariableRector::class);
};
Loading

0 comments on commit 27e9ad0

Please sign in to comment.