Skip to content

SlotStack

Stack tracking nested slot/sub-action executions, so recursion depth is explicit and boundable rather than implicit in the call stack.

final class SlotStack

SourceExecution/SlotStack.php
MethodDescription
depth(): intReturns how many slot executions are currently nested.
hasWarned(string $key): boolReports whether a warning has already been recorded for this key during the current request.
markWarned(string $key): voidRecords that a warning has been emitted for this key, so later checks can suppress duplicates.
occurrences(string $key): intReturns how many times the given key appears anywhere on the stack.
pop(): voidMarks the end of the innermost slot execution; popping an empty stack is a no-op.
push(string $key): voidMarks the start of a nested slot execution by pushing its key onto the stack.

public function depth(): int

Returns how many slot executions are currently nested.

Returns int

public function hasWarned(string $key): bool

Reports whether a warning has already been recorded for this key during the current request.

ParameterTypeDescription
$keystring

Returns bool

public function markWarned(string $key): void

Records that a warning has been emitted for this key, so later checks can suppress duplicates.

ParameterTypeDescription
$keystring

public function occurrences(string $key): int

Returns how many times the given key appears anywhere on the stack.

A count above one means the same slot is rendering itself, which is what recursion guards test against before dispatching again.

ParameterTypeDescription
$keystring

Returns int

public function pop(): void

Marks the end of the innermost slot execution; popping an empty stack is a no-op.

public function push(string $key): void

Marks the start of a nested slot execution by pushing its key onto the stack.

ParameterTypeDescription
$keystring