From 41f3b22c672231c184ec55846c105a0372e656dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dariusz=20Rumi=C5=84ski?= Date: Fri, 22 Sep 2023 23:44:13 +0200 Subject: [PATCH] chore: fix TODO tasks about T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG support (#7316) --- src/Tokenizer/Token.php | 2 +- tests/Tokenizer/TokenTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tokenizer/Token.php b/src/Tokenizer/Token.php index 58399d80586..1009717cbb1 100644 --- a/src/Tokenizer/Token.php +++ b/src/Tokenizer/Token.php @@ -136,7 +136,7 @@ public static function getObjectOperatorKinds(): array */ public function equals($other, bool $caseSensitive = true): bool { - if (\defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG')) { // @TODO: drop condition with new MAJOR release 4.0 + if (\defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG')) { // @TODO: drop condition when PHP 8.1+ is required if ('&' === $other) { return '&' === $this->content && (null === $this->id || $this->isGivenKind([T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG, T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG])); } diff --git a/tests/Tokenizer/TokenTest.php b/tests/Tokenizer/TokenTest.php index 52c6dfe0f30..15cc7628df7 100644 --- a/tests/Tokenizer/TokenTest.php +++ b/tests/Tokenizer/TokenTest.php @@ -407,7 +407,7 @@ public static function provideEqualsCases(): iterable yield [$function, false, [T_FUNCTION, 'function', 'unexpected']]; yield [new Token('&'), true, '&']; - if (\defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG')) { // @TODO: drop condition with new MAJOR release 4.0 + if (\defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG')) { // @TODO: drop condition when PHP 8.1+ is required yield [new Token('&'), true, new Token([T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG, '&'])]; yield [new Token('&'), true, new Token([T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG, '&'])];