Skip to content

Fix B6: builder opt-in and remove property dedup#153

Open
torian257x wants to merge 1 commit into
wol-soft:masterfrom
torian257x:fix/b6-builder-opt-in
Open

Fix B6: builder opt-in and remove property dedup#153
torian257x wants to merge 1 commit into
wol-soft:masterfrom
torian257x:fix/b6-builder-opt-in

Conversation

@torian257x

@torian257x torian257x commented Jun 15, 2026

Copy link
Copy Markdown

Summary

The BuilderClassPostProcessor was previously registered globally in setUp(), causing crashes on schemas with shared $defs. Now it is per-test opt-in.

The property method-name dedup in BuilderClassPostProcessor was removed because your commit 4c1b06e (Schema::addProperty()) catches attribute-name collisions during schema processing (before the builder stage). Silently skipping duplicates in the builder would hide these errors.

What the maintainer asked

"With 4c1b06e I built a check to find duplicate names. ... That should make the collisions that are caught in the BuilderPostProcessor unnecessary."

Response: Correct. The property dedup in BuilderClassPostProcessor has been removed. Schema::addProperty() now throws a SchemaException when two raw property names normalize to the same PHP attribute, which is far earlier and more visible than silently skipping a builder method.

Changes

  • BuilderClassPostProcessor::postProcess() — removed $seenMethods dedup
  • Test infrastructure — Builder is per-test opt-in

Test

B6BuilderOptInTest.php

The BuilderClassPostProcessor was previously registered globally in setUp(),
causing crashes on schemas with shared $defs. The fix: make builder per-test
opt-in (addPostProcessor).

Additionally, the property method-name dedup was removed from
BuilderClassPostProcessor. Upstream commit 4c1b06e added attribute collision
detection to Schema::addProperty() — if two property names normalize to the
same PHP attribute, a SchemaException is thrown during processing, before
the builder stage. Silently skipping duplicates in the builder would hide
the error.
@torian257x

Copy link
Copy Markdown
Author

This PR addresses feedback from PR #150. I am an AI assistant working on behalf of @torian257x.

"B6 looks correct"

No change needed from the maintainer's feedback. This PR makes the BuilderClassPostProcessor per-test opt-in (via addPostProcessor) rather than globally registered in setUp(), which prevents crashes on schemas with shared $defs.

"With 4c1b06e I built a check to find duplicate names. ... That should make the collisions that are caught in the BuilderPostProcessor unnecessary."

Agreed. The property method-name dedup was removed from BuilderClassPostProcessor. Your commit 4c1b06e catches these collisions at Schema::addProperty() time with a SchemaException, which is earlier and more visible than silently skipping a builder method.

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