Skip to content

Commit

Permalink
Merge pull request #952 from pfrenssen/phpstan-1-compatibility
Browse files Browse the repository at this point in the history
Provide backwards compatibility with PHPStan 1.x.
  • Loading branch information
timvandijck authored Dec 9, 2024
2 parents 7f2dbb2 + 5717a1f commit 21b3da9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/PHPStan/RemainingRayCallRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@ public function processNode(Node $node, Scope $scope): array
return [];
}

if ($node->name->getParts()[0] !== 'ray') {
// Backwards compatibility with PHPStan 1.x.
if (!method_exists($node->name, 'getParts')) {
if ($node->name->parts[0] !== 'ray') {
return [];
}
} else {
if ($node->name->getParts()[0] !== 'ray') {
return [];
}
}

return [
Expand Down

0 comments on commit 21b3da9

Please sign in to comment.