From 5717a1fea88f554323c08fa148016285b3eee544 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Mon, 2 Dec 2024 18:35:20 +0200 Subject: [PATCH 1/3] Provide backwards compatibility with PHPStan 1.x. Fixes #951. --- src/PHPStan/RemainingRayCallRule.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PHPStan/RemainingRayCallRule.php b/src/PHPStan/RemainingRayCallRule.php index ad33cc2..39d8289 100644 --- a/src/PHPStan/RemainingRayCallRule.php +++ b/src/PHPStan/RemainingRayCallRule.php @@ -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 [ From c5dbda0548c1881b30549ccc0b6d485f7471aaa5 Mon Sep 17 00:00:00 2001 From: timvandijck Date: Mon, 9 Dec 2024 11:32:15 +0000 Subject: [PATCH 2/3] Fix styling --- src/PHPStan/RemainingRayCallRule.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/PHPStan/RemainingRayCallRule.php b/src/PHPStan/RemainingRayCallRule.php index 39d8289..bd0d4bf 100644 --- a/src/PHPStan/RemainingRayCallRule.php +++ b/src/PHPStan/RemainingRayCallRule.php @@ -21,14 +21,14 @@ public function processNode(Node $node, Scope $scope): array } // Backwards compatibility with PHPStan 1.x. - if (!method_exists($node->name, 'getParts')) { - if ($node->name->parts[0] !== 'ray') { - return []; - } + if (! method_exists($node->name, 'getParts')) { + if ($node->name->parts[0] !== 'ray') { + return []; + } } else { - if ($node->name->getParts()[0] !== 'ray') { - return []; - } + if ($node->name->getParts()[0] !== 'ray') { + return []; + } } return [ From 28e8cedb9d34183496d5145d3f7fe47bdfaef63f Mon Sep 17 00:00:00 2001 From: timvandijck Date: Mon, 9 Dec 2024 11:32:54 +0000 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c1fa8f..d9b2eaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to `ray` will be documented in this file +## 1.41.4 - 2024-12-09 + +### What's Changed + +* Provide backwards compatibility with PHPStan 1.x. by @pfrenssen in https://github.com/spatie/ray/pull/952 + +### New Contributors + +* @pfrenssen made their first contribution in https://github.com/spatie/ray/pull/952 + +**Full Changelog**: https://github.com/spatie/ray/compare/1.41.3...1.41.4 + ## 1.41.3 - 2024-12-02 ### What's Changed