Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 2 additions & 28 deletions build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 404 Rules Overview
# 403 Rules Overview

<br>

Expand All @@ -12,7 +12,7 @@

- [Compatibility](#compatibility) (1)

- [DeadCode](#deadcode) (48)
- [DeadCode](#deadcode) (47)

- [DependencyInjection](#dependencyinjection) (2)

Expand Down Expand Up @@ -2956,32 +2956,6 @@ Remove duplicated key in defined arrays.

<br>

### RemoveDuplicatedIfReturnRector

Remove duplicated if stmt with return in function/method body

- class: [`Rector\DeadCode\Rector\FunctionLike\RemoveDuplicatedIfReturnRector`](../rules/DeadCode/Rector/FunctionLike/RemoveDuplicatedIfReturnRector.php)

```diff
class SomeClass
{
public function run($value)
{
if ($value) {
return true;
}

$value2 = 100;
-
- if ($value) {
- return true;
- }
}
}
```

<br>

### RemoveDuplicatedInstanceOfRector

Remove duplicated instanceof in one call
Expand Down
2 changes: 0 additions & 2 deletions config/set/dead-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use Rector\DeadCode\Rector\For_\RemoveDeadLoopRector;
use Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector;
use Rector\DeadCode\Rector\FunctionLike\RemoveDeadReturnRector;
use Rector\DeadCode\Rector\FunctionLike\RemoveDuplicatedIfReturnRector;
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector;
use Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector;
use Rector\DeadCode\Rector\If_\RemoveUnusedNonEmptyArrayBeforeForeachRector;
Expand Down Expand Up @@ -80,7 +79,6 @@
RemoveEmptyTestMethodRector::class,
RemoveDeadTryCatchRector::class,
RemoveUnusedVariableAssignRector::class,
RemoveDuplicatedIfReturnRector::class,
RemoveUnusedNonEmptyArrayBeforeForeachRector::class,
RemoveEmptyMethodCallRector::class,
RemoveDeadConditionAboveReturnRector::class,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions rules/CodeQuality/Rector/FuncCall/SetTypeToCastRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace Rector\CodeQuality\Rector\FuncCall;

use PhpParser\Node\Expr\ArrayItem;
use PhpParser\Node\Arg;
use PhpParser\Node;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\ArrayItem;
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\Cast;
use PhpParser\Node\Expr\Cast\Array_;
Expand Down
2 changes: 0 additions & 2 deletions rules/CodingStyle/NodeAnalyzer/SpreadVariablesCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

use PhpParser\Node\Param;
use PhpParser\Node\Stmt\ClassMethod;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Reflection\ParameterReflection;
use PHPStan\Reflection\ParametersAcceptor;
use PHPStan\Reflection\ParametersAcceptorSelector;
use Rector\NodeTypeResolver\Node\AttributeKey;

final class SpreadVariablesCollector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use PHPStan\Reflection\ParametersAcceptorSelector;
use Rector\CodingStyle\NodeAnalyzer\SpreadVariablesCollector;
use Rector\CodingStyle\Reflection\VendorLocationDetector;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\Rector\AbstractScopeAwareRector;
use Rector\Core\Reflection\ReflectionResolver;
use Rector\FamilyTree\NodeAnalyzer\ClassChildAnalyzer;
Expand Down Expand Up @@ -133,7 +132,11 @@ private function refactorMethodCall(MethodCall $methodCall, Scope $scope): ?Meth
return null;
}

$parametersAcceptor = ParametersAcceptorSelector::selectFromArgs($scope, $methodCall->getArgs(), $methodReflection->getVariants());
$parametersAcceptor = ParametersAcceptorSelector::selectFromArgs(
$scope,
$methodCall->getArgs(),
$methodReflection->getVariants()
);
$spreadParameterReflections = $this->spreadVariablesCollector->resolveFromParametersAcceptor(
$parametersAcceptor
);
Expand Down
Loading