From ac515400e0b0d220cebb2f66f5d2fffffa0e93d6 Mon Sep 17 00:00:00 2001 From: ArthurErlich Date: Sun, 12 Jul 2026 23:44:32 +0200 Subject: [PATCH] chore(phpstan): remove PHP-Stan-Errors.md All findings it catalogued are resolved; drop the file rather than keep a stale error log around. --- PHP-Stan-Errors.md | 51 ---------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 PHP-Stan-Errors.md diff --git a/PHP-Stan-Errors.md b/PHP-Stan-Errors.md deleted file mode 100644 index 9e89c09..0000000 --- a/PHP-Stan-Errors.md +++ /dev/null @@ -1,51 +0,0 @@ -# PHPStan level 8 — first run - -**Resolved.** All 22 errors below were closed by adding the missing -array-shape docblocks (plus two `(int) strtotime()` casts and an -`array_values()` re-index in `ContributionCollection`). `composer phpstan` -now reports zero errors. Kept here as a record of what level 8 flagged on -first run. - -`composer phpstan` (level 8, `paths: [src, tests]`) reports 22 errors, all -`missingType.iterableValue` / `missingType.generics` — none are correctness -bugs, all are missing `@param`/`@return` array-shape docblocks on iterable -parameters. - -Run: `docker compose exec graph composer phpstan` (needs `--memory-limit=512M` -if run directly via `vendor/bin/phpstan analyse`, the default 128M crashes on -this project's parallel workers). - -## `missingType.iterableValue` — `iterable $providers` constructor params - -- `src/Command/RefetchContributionsCommand.php:29` -- `src/Service/ContributionAggregator.php:16` -- `src/Service/Provider/ProviderHealthChecker.php:11` - -Fix: add `@param iterable $providers` above each -constructor. - -## `missingType.iterableValue` — `SvgRenderer.php` (8 occurrences) - -Every `array` parameter/return on `render()`, `buildGrid()`, -`computeStats()`, `renderMonthLabels()`, `renderCells()`, `renderLegend()` is -untyped. Fix: add `@param array` / `@return array<...>` shapes -matching each method's actual contents (contribution date=>count maps, grid -cell arrays, color arrays). - -## `missingType.generics` / `assign.propertyType` — `ContributionCollection.php` - -- Line 17: `$contributions` is typed `array` but - `array_map` over `Contribution ...$contributions` in the constructor can - produce non-sequential/string keys. Fix: re-index with `array_values()` - before assigning, or relax the property type to `array`. -- Line 20: `getIterator(): \ArrayIterator` needs generic types: - `@return \ArrayIterator`. - -## `missingType.iterableValue` — test doubles/providers (8 occurrences) - -Stub/fixture helper methods with untyped `array` params in -`RefetchContributionsCommandTest`, `ContributionAggregatorTest`, -`GitHubProviderTest`, `GitLabProviderTest`, `GiteaProviderTest`, and the two -PHPUnit data providers in `SvgRendererTest`. Fix: add -`@param array $fresh` (or the relevant shape) / `@return -iterable` on the data providers.