From 36102ae3e7e6f057152eeecb1a03014b998c95dc Mon Sep 17 00:00:00 2001 From: Jake Hotson Date: Wed, 20 May 2026 01:11:58 +0100 Subject: [PATCH] [BUGFIX] Use `@phpstan-ignore` not `@phpstan-ignore-next-line` `@phpstan-ignore` has the parameter which is the specific warning to ignore. `@phpstan-ignore-next-line` does not, and will result in suppression of all warnings for the next line. `@phpstan-ignore` also only applies to the next line (or whatever is relevent in context). --- tests/Unit/Parsing/UnexpectedEOFExceptionTest.php | 2 +- tests/Unit/Parsing/UnexpectedTokenExceptionTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Unit/Parsing/UnexpectedEOFExceptionTest.php b/tests/Unit/Parsing/UnexpectedEOFExceptionTest.php index b3c2ffcc9..e430e94ca 100644 --- a/tests/Unit/Parsing/UnexpectedEOFExceptionTest.php +++ b/tests/Unit/Parsing/UnexpectedEOFExceptionTest.php @@ -85,7 +85,7 @@ public function messageForInvalidMatchTypeRefersToTokenNotFound(): void $expected = 'tea'; $found = 'coffee'; - // @phpstan-ignore-next-line argument.type We're explicitly testing with an invalid value here. + // @phpstan-ignore argument.type (We're explicitly testing with an invalid value here.) $exception = new UnexpectedEOFException($expected, $found, 'coding'); $expectedMessage = 'Token “' . $expected . '” (coding) not found. Got “' . $found . '”.'; diff --git a/tests/Unit/Parsing/UnexpectedTokenExceptionTest.php b/tests/Unit/Parsing/UnexpectedTokenExceptionTest.php index 6adb3d7e0..fbb45bf9a 100644 --- a/tests/Unit/Parsing/UnexpectedTokenExceptionTest.php +++ b/tests/Unit/Parsing/UnexpectedTokenExceptionTest.php @@ -85,7 +85,7 @@ public function messageForInvalidMatchTypeRefersToTokenNotFound(): void $expected = 'tea'; $found = 'coffee'; - // @phpstan-ignore-next-line argument.type We're explicitly testing with an invalid value here. + // @phpstan-ignore argument.type (We're explicitly testing with an invalid value here.) $exception = new UnexpectedTokenException($expected, $found, 'coding'); $expectedMessage = 'Token “' . $expected . '” (coding) not found. Got “' . $found . '”.';