fix(4e-review M1): Update unterscheidet Composer und Zweitdurchlauf nach der ganzen Schleifen-Kette (LoopScope::key)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-20 00:38:33 +02:00
co-authored by Claude Sonnet 5.5
parent b91c356a28
commit 8be2f5e558
3 changed files with 70 additions and 4 deletions
@@ -94,6 +94,18 @@ final class LoopScope
return $this->queryType === null ? [] : [$this->kind(), ...$this->outerKinds];
}
/**
* Identity of the context: the loop and the kinds of its whole chain (audit M1). Two scopes with the same key
* resolve every loop_* reference the same way; no loop is "-|".
*/
public function key(): string
{
return ($this->queryType ?? '-') . '|' . implode(',', array_map(
static fn (?string $kind): string => $kind ?? '?',
$this->kinds()
));
}
/** Whether there is a loop whose loop_* options the tools allow. */
public function active(): bool
{