re #96 burn down PHPStan baseline (4): Http, Container#105
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fourth chunk of the #96 level-6 burn-down — two parallel per-package passes. Baseline
phpstan-baseline.neon: 437 → 325 entries (−112).array<string, mixed>/array<string, list<string>>), Payload/Action/responder/formatter/validator/auth-trait shapes, interface return typesarray<int|string, mixed>, executable-structurearray{...}tuples,ReflectionClass<object>, reflection-param lists;mixed/object/stringparams aligned with interfacesProperty 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()typedarray<array-key, mixed>rather thanarray<string, mixed>, because the stricter type would surface a latent positional destructure ([$user, $password] = $credentials) inTokenAuthenticationMiddleware— a separate bug, out of scope here. The concreteBodyCredentialsExtractorkeeps the precisearray<string, mixed>|null(valid covariant subtype).Left behind (need real code work): Http PSR/subtype conflicts, third-party class-not-found,
MapInterface-return findings; ContainerExecutableReflectionFunctionAbstractsubtype findings + collections' non-genericMapInterfacereturns.Rector then applied two annotation-unlocked cleanups (a redundant cast removal, a useless
@return voidremoval).Gates:
composer stangreen (325 baselined, 0 live), CS clean, rector--dry-runclean, full suite at the 5 pre-existingext-mongodb/ext-memcachedenvironmental 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.