Skip to content

[Server] Freeze Builder after build() and drop hasCustomRegistry flag - #44

Open
chr-hertel wants to merge 1 commit into
mainfrom
fix/issue-10-builder-build-guard
Open

[Server] Freeze Builder after build() and drop hasCustomRegistry flag#44
chr-hertel wants to merge 1 commit into
mainfrom
fix/issue-10-builder-build-guard

Conversation

@chr-hertel

Copy link
Copy Markdown
Owner

Part of #10 — the two internal fixes, not the decomposition.

  • assemble() memoises into $this->parts, but every setter stayed callable afterwards and silently changed nothing. Every setter/add method now throws a LogicException ("Builder is frozen after build()...") once the configuration has been resolved. Repeated build()/buildStateless() calls still share the one wiring.
  • private RegistryInterface $registry; (uninitialised) plus the parallel $hasCustomRegistry flag collapsed into ?RegistryInterface $registry = null.

Full unit suite, php-cs-fixer and phpstan green.

Confidence: 9/10 — mechanical guard + one-field collapse, both covered by new tests and the existing 1534-test suite; only residual risk is exotic downstream code that mutated a builder after build() and relied on the silent no-op.

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