Skip to content

Commit

Permalink
Updated Rector to commit fbba8606a56e0643a7b3d1ae9af5fded082eea06
Browse files Browse the repository at this point in the history
rectorphp/rector-src@fbba860  [Php80] Skip ObjectType on ChangeSwitchToMatchRector  (#5719)
  • Loading branch information
TomasVotruba committed Mar 14, 2024
1 parent d9fea10 commit ea97f93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions rules/Php80/Rector/Switch_/ChangeSwitchToMatchRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\Return_;
use PhpParser\Node\Stmt\Switch_;
use PHPStan\Type\ObjectType;
use Rector\Contract\PhpParser\Node\StmtsAwareInterface;
use Rector\Php80\NodeAnalyzer\MatchSwitchAnalyzer;
use Rector\Php80\NodeFactory\MatchFactory;
Expand Down Expand Up @@ -101,6 +102,9 @@ public function refactor(Node $node) : ?Node
continue;
}
$isReturn = $this->matchSwitchAnalyzer->isReturnCondsAndExprs($condAndExprs);
if ($this->nodeTypeResolver->getType($stmt->cond) instanceof ObjectType) {
continue;
}
$matchResult = $this->matchFactory->createFromCondAndExprs($stmt->cond, $condAndExprs, $nextStmt);
if (!$matchResult instanceof MatchResult) {
continue;
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'd01d16e9d8c7225e5a45cb2534b1b338f93e5740';
public const PACKAGE_VERSION = 'fbba8606a56e0643a7b3d1ae9af5fded082eea06';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-03-14 10:11:24';
public const RELEASE_DATE = '2024-03-14 15:25:09';
/**
* @var int
*/
Expand Down

0 comments on commit ea97f93

Please sign in to comment.