NaifyView\Compiler\CompiledLoopSourceBuilder クラス

CompiledLoopSourceBuilder — compiled mainline の Compiled Loop Source Builder

template を generated PHP class へ落とす compile pipeline の一部。 大きな compiler へ責務を押し込まず、source 生成・依存計画・fast path などを小さく分ける。

使用例

// Engine が warm-hit できない template を compiled artifact へ変換する時に使う。
// 通常は View / Engine 経由で呼ばれ、アプリ側から直接操作しない。

プロパティ

名前型説明
private $expressionFastPathBuilder CompiledExpressionFastPathBuilder expression lowering owner

メソッド

メソッド説明
public __construct(CompiledExpressionFastPathBuilder $expressionFastPathBuilder): void インスタンスを初期化する
public buildCompiledIterableNormalizationLines(string $itemsVar, string $iterableVar, string $expression, string $scopeVar, int $indentLevel, ?string $bufferedKeysVar): array `buildCompiledIterableNormalizationLines()` を実行する
public buildCompiledRangePreparationLines(string $scopeVar, string $startRawVar, string $startVar, string $startExpression, string $endRawVar, string $endVar, string $endExpression, string $stepRawVar, string $stepVar, ?string $stepExpression, string $itemsVar, string $lengthVar, int $indentLevel, bool $needsLength = true): array `buildCompiledRangePreparationLines()` を実行する
public buildCompiledForEachScopeLines(string $scopeVar, string $parentScopeVar, ?string $valueVariable, ?string $keyVariable, ?string $loopName, string $keyVar, string $valueVar, string $indexVar, string $lengthVar, int $indentLevel, int $counter): array `buildCompiledForEachScopeLines()` を実行する
public buildCompiledForRangeScopeLines(string $scopeVar, string $parentScopeVar, ?string $variableName, ?string $loopName, string $valueVar, string $indexVar, string $lengthVar, int $indentLevel, int $counter): array `buildCompiledForRangeScopeLines()` を実行する
public buildCompiledLoopStateLines(string $scopeVar, ?string $loopName, string $loopStateVar, string $indexVar, string $lengthVar, int $indentLevel): array `buildCompiledLoopStateLines()` を実行する
private buildCompiledNumericNormalizationLines(string $rawVar, string $targetVar, string $expression, int $indentLevel): array `buildCompiledNumericNormalizationLines()` を実行する
private indent(int $level): string `indent()` を実行する