NaifyView\Compiler\CompiledTemplateCompositionSourceBuilder クラス

CompiledTemplateCompositionSourceBuilder — compiled mainline の Compiled Template Composition Source Builder

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

使用例

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

プロパティ

名前型説明
private $bindingParser NaifyBindingParser compile-time with binding parser
private $expressionFastPathBuilder CompiledExpressionFastPathBuilder compile-time expression lowering owner
private $compileLevel string generated PHP readability / exposure level
private $interpolationOpen string

メソッド

メソッド説明
public __construct(NaifyBindingParser $bindingParser, CompiledExpressionFastPathBuilder $expressionFastPathBuilder, string $compileLevel = debug, string $interpolationOpen = {{): void インスタンスを初期化する
public buildCompiledBoundScopeLines(string $targetScopeVar, string $parentScopeVar, ?string $withExpression, int $indentLevel): array `buildCompiledBoundScopeLines()` を実行する
public buildCompiledIncludeLines(IncludeNode $node, string $scopeVar, string $outputVar, int $indentLevel, int $counter, string $stateVar, string $currentTemplatePath, callable $resolveTemplatePath, callable $buildDisplayTemplatePath, callable $loadTemplateDocument, callable $recordTemplateDependency, callable $registerTemplateMethod): array `buildCompiledIncludeLines()` を実行する
private buildRuntimeIncludeLines(IncludeNode $node, string $scopeVar, string $outputVar, int $indentLevel, int $counter, string $stateVar, string $currentTemplatePath): array `buildRuntimeIncludeLines()` を実行する
private extractStaticIncludedText(DocumentNode $document): ?string `extractStaticIncludedText()` を実行する
private extractStaticIncludedSource(string $source): ?string `extractStaticIncludedSource()` を実行する
public buildCompiledLayoutLines(LayoutNode $node, string $scopeVar, string $outputVar, int $indentLevel, int $counter, string $stateVar, string $currentTemplatePath, string $currentTemplateSource, callable $resolveTemplatePath, callable $buildDisplayTemplatePath, callable $loadTemplateDocument, callable $registerTemplateMethod, callable $requireLayoutDefinitionMethod, callable $registerSlotOverrideMethod): array `buildCompiledLayoutLines()` を実行する
public buildCompiledSlotLines(SlotNode $node, string $scopeVar, string $outputVar, int $indentLevel, int $counter, string $stateVar, string $slotOverridesVar, callable $compileChildren): array `buildCompiledSlotLines()` を実行する
public buildCompiledBlockLines(BlockNode $node, string $scopeVar, string $outputVar, int $indentLevel, int $counter, string $stateVar, callable $compileChildren): array `buildCompiledBlockLines()` を実行する
private wrapParentScopeLines(array $lines, string $scopeVar, int $indentLevel, int $counter): array Keep isolated composition scopes balanced even when a loop signal escapes.
private indent(int $level): string `indent()` を実行する
private buildSourceCommentLines(string $indent, string $comment): array `buildSourceCommentLines()` を実行する
private normalizeCompileLevel(string $compileLevel): string `normalizeCompileLevel()` を実行する