NaifyView\Compiler\CompiledOutputChunkBuilder クラス

CompiledOutputChunkBuilder — compiled mainline の Compiled Output Chunk Builder

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

使用例

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

プロパティ

名前型説明
private $elementSourceBuilder CompiledElementSourceBuilder
private $expressionFastPathBuilder CompiledExpressionFastPathBuilder
private $sourceMetadataBuilder CompiledGeneratedSourceMetadataBuilder

メソッド

メソッド説明
public __construct(CompiledElementSourceBuilder $elementSourceBuilder, CompiledExpressionFastPathBuilder $expressionFastPathBuilder, CompiledGeneratedSourceMetadataBuilder $sourceMetadataBuilder): void インスタンスを初期化する
public coalesceAppendLines(array $lines, string $outputVar): array `coalesceAppendLines()` を実行する
public tryConsumeOutputChunk(array $nodes, int $startIndex, string $scopeVar, string $outputVar, int $indentLevel): ?array `tryConsumeOutputChunk()` を実行する
private buildOutputChunkSegment(NodeInterface $node, string $scopeVar): ?string `buildOutputChunkSegment()` を実行する
private buildElementChunkSegment(ElementNode $node, string $scopeVar): ?string `buildElementChunkSegment()` を実行する
private buildInterpolationChunkSegment(InterpolationNode $node, string $scopeVar): ?string `buildInterpolationChunkSegment()` を実行する
private flushAppendExpressions(array $lines, ?string $indent, array $expressions, string $outputVar): void `flushAppendExpressions()` を実行する
private extractAppendExpression(string $line, string $outputVar): ?array `extractAppendExpression()` を実行する
private indent(int $level): string `indent()` を実行する