chore(todo): checked php stan instalation and configuration. added document php stan erros as well to update readme docs
This commit is contained in:
@@ -18,8 +18,7 @@ Order matters — later steps assume earlier ones are done.
|
||||
`config/packages/idci_graphql_client.yaml`. Run `composer update` and
|
||||
commit the regenerated `composer.lock`.
|
||||
|
||||
- [x] **Dedupe `baseUrl` normalization.** `GitLabProvider.php` (lines 41,
|
||||
53) and `GiteaProvider.php` (lines 42, 54) each call
|
||||
- [x] **Dedupe `baseUrl` normalization.** `GitLabProvider.php` (lines 41, 53) and `GiteaProvider.php` (lines 42, 54) each call
|
||||
`rtrim($this->baseUrl..., '/')` twice — once in `ping()`, once in
|
||||
`fetch()`. Compute it once as a `private readonly string $baseUrl` in
|
||||
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
|
||||
retention is unset/0.
|
||||
- [x] Constructor takes `?int $retentionDays` bound from new env var
|
||||
`CONTRIBUTIONS_RETENTION_DAYS` (empty/default = keep forever). *(constructor
|
||||
param wired; the env binding itself is step 6's job.)*
|
||||
`CONTRIBUTIONS_RETENTION_DAYS` (empty/default = keep forever). _(constructor
|
||||
param wired; the env binding itself is step 6's job.)_
|
||||
- [x] Tests: `tests/Unit/Service/ContributionStoreTest.php` — store &
|
||||
retrieve, upsert overwrites existing date, `sinceDays` filtering,
|
||||
`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
|
||||
App\Service\ContributionStore:
|
||||
arguments:
|
||||
$dbPath: '%kernel.project_dir%/var/data/contributions.db'
|
||||
$retentionDays: '%env(int:CONTRIBUTIONS_RETENTION_DAYS)%'
|
||||
$dbPath: "%kernel.project_dir%/var/data/contributions.db"
|
||||
$retentionDays: "%env(int:CONTRIBUTIONS_RETENTION_DAYS)%"
|
||||
```
|
||||
Add `env(CONTRIBUTIONS_RETENTION_DAYS): ''` to `parameters:` (empty →
|
||||
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
|
||||
|
||||
- [ ] `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).
|
||||
- [ ] Add `phpstan.neon`: `paths: [src, tests]`, `level: 8`.
|
||||
- [x] Add `phpstan.neon`: `paths: [src, tests]`, `level: 8`.
|
||||
- [ ] 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user