From c188abbf2c62c62420c972b59c34a1b5793ea578 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Tue, 29 Jul 2025 22:28:45 +0200 Subject: [PATCH] [CLEANUP] Ignore warnings for explicitly invalid values in tests --- config/phpstan-baseline.neon | 12 ------------ tests/Unit/Parsing/UnexpectedEOFExceptionTest.php | 1 + tests/Unit/Parsing/UnexpectedTokenExceptionTest.php | 1 + 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon index 1180333e..7cc38e69 100644 --- a/config/phpstan-baseline.neon +++ b/config/phpstan-baseline.neon @@ -119,15 +119,3 @@ parameters: identifier: argument.type count: 2 path: ../tests/Unit/CSSList/CSSListTest.php - - - - message: '#^Parameter \#3 \$matchType of class Sabberworm\\CSS\\Parsing\\UnexpectedEOFException constructor expects ''count''\|''custom''\|''expression''\|''identifier''\|''literal''\|''search'', ''coding'' given\.$#' - identifier: argument.type - count: 1 - path: ../tests/Unit/Parsing/UnexpectedEOFExceptionTest.php - - - - message: '#^Parameter \#3 \$matchType of class Sabberworm\\CSS\\Parsing\\UnexpectedTokenException constructor expects ''count''\|''custom''\|''expression''\|''identifier''\|''literal''\|''search'', ''coding'' given\.$#' - identifier: argument.type - count: 1 - path: ../tests/Unit/Parsing/UnexpectedTokenExceptionTest.php diff --git a/tests/Unit/Parsing/UnexpectedEOFExceptionTest.php b/tests/Unit/Parsing/UnexpectedEOFExceptionTest.php index 32a649a0..b3c2ffcc 100644 --- a/tests/Unit/Parsing/UnexpectedEOFExceptionTest.php +++ b/tests/Unit/Parsing/UnexpectedEOFExceptionTest.php @@ -85,6 +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. $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 d4fa9eca..6adb3d7e 100644 --- a/tests/Unit/Parsing/UnexpectedTokenExceptionTest.php +++ b/tests/Unit/Parsing/UnexpectedTokenExceptionTest.php @@ -85,6 +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. $exception = new UnexpectedTokenException($expected, $found, 'coding'); $expectedMessage = 'Token “' . $expected . '” (coding) not found. Got “' . $found . '”.';