Conversation
… Contract (#2) Two things that hid each other, both found while re-checking Posten P-45. **1. The gate ignored its own configuration.** `phpstan.neon` declares `paths: src, tests`, but the make target ran `phpstan analyse /app/src -c phpstan.neon` — a positional path SUBSTITUTES the `paths:` key, so the whole test tree was never analysed. Measured before the change: `/app/src` and the config's own paths both report 0 findings at level 8, so widening costs nothing here. CI runs `make phpstan`, so the widening takes effect there too. **2. Two hand-written DomainResponseInterface implementations declared their data wider than the Contract they implement.** `tests/Support/DomainResponse` and `examples/basic/app/Support/StaticDomainResponse` typed `$data`/`$errors` as flat `array<string, mixed>`, while the interface promises context-keyed maps. That let tests build a response the real pipeline cannot produce: every generated `ContextResponse::getData()` returns `[$context => $data]` — 13 of 13 instances in the generated corpus, wordfor word identical. Even the 422 `{rule, messageKey, context}` payload sits under the context key, because the Command handlers write it through `$this->result()->setData(...)`. With the fakes tightened, the widened gate reported 7 findings, each on its own line: MapDomainResponseTest 46/47/85/103, ResolveResponseTest 33, ResolveRouteHandlerTest 45, AppTest 158 — all of them flat data under a context key. All seven moved to the context-keyed shape; no assertion weakened, the expectations moved with the inputs. The 422 test now carries its payload where the generator actually puts it, with the evidence named in a comment. Nothing shipped changes: `autoload` covers only `JardisCore\App\ -> src/`; `tests/` and `examples/` are `autoload-dev`. Gates: phpcs 0 · phpstan 0 (now src AND tests) · phpunit 122/122, 312 assertions. Context and the counter-evidence against P-45 as written: `claude/docs/standortbestimmung-php-2026-08/belege-s55/NACHPRUEFUNG-p45-hauptdialog.md`.
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.
Auto PATCH release triggered by
fix/260809_phpstan_umfang_und_attrappen.