From 0c0262eb4def7e6e586a2a3f4a5018c5b95f8807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vi=CC=81ctor=20Falco=CC=81n?= Date: Sat, 4 Jul 2026 21:31:15 +0200 Subject: [PATCH] fix(static-analysis): drop mismatched CategorySpendingService return generic PHPStan flagged forPeriod()'s @return Collection> because Collection's TValue is invariant and the concrete rolled-up shape (with a positive-int amount narrowed by the amount>0 filter) is not equal to the declared one. Even declaring the exact array shape still trips the invariance check on the filter-narrowed value type. Restore the original methods' bare Collection contract (no generic @return), which is how the two controller methods this was extracted from already passed static analysis. Doc-only; no behavior change. --- app/Services/CategorySpendingService.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Services/CategorySpendingService.php b/app/Services/CategorySpendingService.php index b2cddfba..3e41836d 100644 --- a/app/Services/CategorySpendingService.php +++ b/app/Services/CategorySpendingService.php @@ -19,8 +19,6 @@ class CategorySpendingService * ancestor so only parents are listed. With one, the parent's children * become the rows (plus a direct node for transactions sitting on the * parent itself). Soft-deleted categories are excluded. - * - * @return Collection> */ public function forPeriod(string $userId, Carbon $from, Carbon $to, ?string $drillParentId = null): Collection {