chore(todo): checked php stan instalation and configuration. added document php stan erros as well to update readme docs

This commit is contained in:
2026-07-12 12:43:33 +02:00
parent e7f14dfd35
commit 0d7cf68771
+9 -9
View File
@@ -18,8 +18,7 @@ Order matters — later steps assume earlier ones are done.
`config/packages/idci_graphql_client.yaml`. Run `composer update` and `config/packages/idci_graphql_client.yaml`. Run `composer update` and
commit the regenerated `composer.lock`. commit the regenerated `composer.lock`.
- [x] **Dedupe `baseUrl` normalization.** `GitLabProvider.php` (lines 41, - [x] **Dedupe `baseUrl` normalization.** `GitLabProvider.php` (lines 41, 53) and `GiteaProvider.php` (lines 42, 54) each call
53) and `GiteaProvider.php` (lines 42, 54) each call
`rtrim($this->baseUrl..., '/')` twice — once in `ping()`, once in `rtrim($this->baseUrl..., '/')` twice — once in `ping()`, once in
`fetch()`. Compute it once as a `private readonly string $baseUrl` in `fetch()`. Compute it once as a `private readonly string $baseUrl` in
the constructor instead. the constructor instead.
@@ -101,8 +100,8 @@ Order matters — later steps assume earlier ones are done.
the configured retention window (a unix timestamp cutoff); no-ops if the configured retention window (a unix timestamp cutoff); no-ops if
retention is unset/0. retention is unset/0.
- [x] Constructor takes `?int $retentionDays` bound from new env var - [x] Constructor takes `?int $retentionDays` bound from new env var
`CONTRIBUTIONS_RETENTION_DAYS` (empty/default = keep forever). *(constructor `CONTRIBUTIONS_RETENTION_DAYS` (empty/default = keep forever). _(constructor
param wired; the env binding itself is step 6's job.)* param wired; the env binding itself is step 6's job.)_
- [x] Tests: `tests/Unit/Service/ContributionStoreTest.php` — store & - [x] Tests: `tests/Unit/Service/ContributionStoreTest.php` — store &
retrieve, upsert overwrites existing date, `sinceDays` filtering, retrieve, upsert overwrites existing date, `sinceDays` filtering,
`prune()` no-ops when retention unset, `prune()` deletes rows older `prune()` no-ops when retention unset, `prune()` deletes rows older
@@ -147,8 +146,8 @@ PHP `max_execution_time` fatal can't be caught by `try/catch` at all, so
```yaml ```yaml
App\Service\ContributionStore: App\Service\ContributionStore:
arguments: arguments:
$dbPath: '%kernel.project_dir%/var/data/contributions.db' $dbPath: "%kernel.project_dir%/var/data/contributions.db"
$retentionDays: '%env(int:CONTRIBUTIONS_RETENTION_DAYS)%' $retentionDays: "%env(int:CONTRIBUTIONS_RETENTION_DAYS)%"
``` ```
Add `env(CONTRIBUTIONS_RETENTION_DAYS): ''` to `parameters:` (empty → Add `env(CONTRIBUTIONS_RETENTION_DAYS): ''` to `parameters:` (empty →
casts to `0` → `prune()`'s existing `retentionDays === 0` check already casts to `0` → `prune()`'s existing `retentionDays === 0` check already
@@ -226,11 +225,12 @@ incremental `latestDate()` window entirely for the providers/range given.
## 10. PHPStan ## 10. PHPStan
- [ ] `composer require --dev phpstan/phpstan` (plain PHPStan — no - [x] `composer require --dev phpstan/phpstan` (plain PHPStan — no
Symfony extension needed for this app's size). Symfony extension needed for this app's size).
- [ ] Add `phpstan.neon`: `paths: [src, tests]`, `level: 8`. - [x] Add `phpstan.neon`: `paths: [src, tests]`, `level: 8`.
- [ ] Add composer script `"phpstan": "phpstan analyse"`. - [ ] Add composer script `"phpstan": "phpstan analyse"`.
- [ ] Fix whatever level-8 flags on first run. - [ ] Update README.md docs with new command and php stan static lintin.
- [ ] Document in PHP-Stan-Errors.md whatever level-8 flags on first run.
## 11. `CLAUDE.md` update ## 11. `CLAUDE.md` update