From 42e4c99c063732bcf8cdb90f4628084e8eb8bec5 Mon Sep 17 00:00:00 2001 From: soyuka Date: Fri, 3 Jul 2026 07:31:17 +0200 Subject: [PATCH] fix(test): remove stale phpstan ignores in CollectionNormalizerTest composer.lock pins phpstan/phpstan to 2.2.3, and that version improved conditional-type narrowing: it now correctly infers that inside the `if (!$partial)` branch, $paginator is PaginatorInterface (which declares getLastPage()/getTotalItems()), whereas 2.1.x lost that correlation and reported a phpunit.mockMethod error there. The `@phpstan-ignore-line` comments suppressing that error are now unmatched, and reportUnmatchedIgnoredErrors turns unmatched ignores into hard failures. Removed the two stale ignores; the adjacent valid()/current() ignores above are still matched and left in place. --- src/Hal/Tests/Serializer/CollectionNormalizerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Hal/Tests/Serializer/CollectionNormalizerTest.php b/src/Hal/Tests/Serializer/CollectionNormalizerTest.php index 73095b1cd60..1f5bc63e3f6 100644 --- a/src/Hal/Tests/Serializer/CollectionNormalizerTest.php +++ b/src/Hal/Tests/Serializer/CollectionNormalizerTest.php @@ -125,8 +125,8 @@ private function normalizePaginator(bool $partial = false): array $paginator->method('current')->willReturn('foo'); // @phpstan-ignore-line if (!$partial) { - $paginator->method('getLastPage')->willReturn(7.); // @phpstan-ignore-line - $paginator->method('getTotalItems')->willReturn(1312.); // @phpstan-ignore-line + $paginator->method('getLastPage')->willReturn(7.); + $paginator->method('getTotalItems')->willReturn(1312.); } else { $paginator->method('count')->willReturn(12); }