Skip to content

re #96 burn down PHPStan baseline (4): Http, Container#105

Merged
tonydspaniard merged 1 commit into
masterfrom
feat/96-phpstan-burndown-4
May 28, 2026
Merged

re #96 burn down PHPStan baseline (4): Http, Container#105
tonydspaniard merged 1 commit into
masterfrom
feat/96-phpstan-burndown-4

Conversation

@tonydspaniard
Copy link
Copy Markdown
Member

Fourth chunk of the #96 level-6 burn-down — two parallel per-package passes. Baseline phpstan-baseline.neon: 437 → 325 entries (−112).

Package Before → After Highlights
Http 97 → 27 request/response attribute + header + parsed-body arrays (array<string, mixed> / array<string, list<string>>), Payload/Action/responder/formatter/validator/auth-trait shapes, interface return types
Container 48 → 6 definition/parameter arrays array<int|string, mixed>, executable-structure array{...} tuples, ReflectionClass<object>, reflection-param lists; mixed/object/string params aligned with interfaces

Property safety applied: Http properties were annotated via @var (not native types) to avoid the uninitialised-property breakage that bit the previous chunk — the full suite confirms no runtime regressions this time.

Good judgment by the Http pass: CredentialsExtractorInterface::extract() typed array<array-key, mixed> rather than array<string, mixed>, because the stricter type would surface a latent positional destructure ([$user, $password] = $credentials) in TokenAuthenticationMiddleware — a separate bug, out of scope here. The concrete BodyCredentialsExtractor keeps the precise array<string, mixed>|null (valid covariant subtype).

Left behind (need real code work): Http PSR/subtype conflicts, third-party class-not-found, MapInterface-return findings; Container Executable ReflectionFunctionAbstract subtype findings + collections' non-generic MapInterface returns.

Rector then applied two annotation-unlocked cleanups (a redundant cast removal, a useless @return void removal).

Gates: composer stan green (325 baselined, 0 live), CS clean, rector --dry-run clean, full suite at the 5 pre-existing ext-mongodb/ext-memcached environmental errors.

Part of #96. Progress: 719 → 325 (55% cleared). Remaining: Structure (250) — the generics design effort, its own PR(s) — plus ~75 code-quality/subtype leftovers spread across packages.

Fourth level-6 burn-down chunk (parallel per-package passes), baseline
437 -> 325 entries (-112). Precise types at the root cause; baseline
regenerated, not hand-edited.

- Http (97->27): request/response attribute + header + parsed-body arrays
  (array<string, mixed> / array<string, list<string>>); Payload/Action/
  responder/formatter/validator/auth-trait shapes; interface return types.
  Properties annotated via @var (not native) to avoid uninitialised-property
  breakage. CredentialsExtractorInterface::extract typed array<array-key,
  mixed> on purpose — array<string, mixed> would surface a latent positional
  destructure in TokenAuthenticationMiddleware (out of scope). Left: PSR/
  subtype conflicts, third-party class-not-found, MapInterface-return findings.
- Container (48->6): definition/parameter arrays array<int|string, mixed>,
  executable-structure tuples, ReflectionClass<object>, reflection-param
  lists; mixed/object/string params aligned with their interfaces. Left:
  Executable ReflectionFunctionAbstract subtype findings + the collections'
  non-generic MapInterface returns.

Rector then applied two annotation-unlocked cleanups (redundant cast removal,
useless @return void removal). composer stan / cs / rector --dry-run green;
full suite at the 5 pre-existing ext-mongodb environmental errors (no
regressions — the @var-over-native-property rule avoided the init bug seen
in the previous chunk). Remaining under #96: Structure (250, generics) +
~75 code-quality/subtype leftovers across packages.
@tonydspaniard tonydspaniard merged commit 69e9594 into master May 28, 2026
3 checks passed
@tonydspaniard tonydspaniard deleted the feat/96-phpstan-burndown-4 branch May 28, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant