fix(4e-review M-1): Schleifen-Warnung nennt die ganze Kette (Terme > Beiträge); loopWhere mit frühen Returns

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-20 00:40:05 +02:00
co-authored by Claude Sonnet 5.5
parent 8be2f5e558
commit 71ffbdbf59
3 changed files with 41 additions and 16 deletions
@@ -132,6 +132,17 @@ final class LoopScope
return $kind === null ? (string) $this->queryType : self::LABELS[$kind];
}
/** label() of the whole chain, outermost first ("Terme > Beiträge"); an unknown outer loop shows as "?". */
public function chainLabel(): string
{
$labels = array_map(
static fn (?string $kind): string => $kind === null ? '?' : self::LABELS[$kind],
array_slice($this->kinds(), 1)
);
return implode(' > ', [...array_reverse($labels), $this->label()]);
}
/**
* Whether the loop_* option $option belongs to this loop's kind – a meta key option (loop_<kind>_meta_key_*)
* to the kind of every loop of the chain (audit M1), since Divi reads meta by the ID of whatever loop