You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix deep path chain and __root__ template cascading bugs
Result::withPath() previously set `$this->path->parent = $path` directly
on the leaf node, overwriting intermediate path segments. With 3+ levels
of nested keys (e.g. server.database.host), the middle segment was lost,
producing `.server.host` instead of `.server.database.host`. The fix
walks to the root of the existing path chain before appending.
TemplateResolver::getGivenTemplate() treated `__root__` as a universal
fallback in the lookup chain, causing it to match ALL results in the tree
instead of only the composite it was intended for. The fix introduces an
`$isRoot` flag threaded from each formatter through the Renderer into
TemplateResolver, combined with a `fullyConsumed` check from path
drilling, so `__root__` only applies when the result is at the correct
template scope.
Optimizations made during the fixes:
- NestedListStringFormatter::isVisible(): replaced O(n!) mutual sibling
recursion with O(n) linear scan — the transitive visibility check
reduces to "does any sibling have a custom template or != 1 children"
- InterpolationRenderer: inlined getValidatorTemplate() into the ??
expression so it short-circuits when a given template exists
Add 12 feature tests covering deep path rendering, multi-level __root__
scoping, deep template resolution, partial template coverage, and mixed
depth siblings.
0 commit comments