fix(static-analysis): drop mismatched CategorySpendingService return generic

PHPStan flagged forPeriod()'s @return Collection<int, array<string, mixed>>
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.
This commit is contained in:
Víctor Falcón 2026-07-04 21:31:15 +02:00
parent 0d7e39705e
commit 0c0262eb4d
1 changed files with 0 additions and 2 deletions

View File

@ -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<int, array<string, mixed>>
*/
public function forPeriod(string $userId, Carbon $from, Carbon $to, ?string $drillParentId = null): Collection
{