NaifyView\Compiler\CompiledElementSourceBuilder クラス

CompiledElementSourceBuilder — compiled mainline の Compiled Element Source Builder

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

使用例

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

プロパティ

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

メソッド

メソッド説明
public __construct(CompiledExpressionFastPathBuilder $expressionFastPathBuilder): void インスタンスを初期化する
public buildOpenElementFrameExpression(string $tagName, string $attributeVar): string `buildOpenElementFrameExpression()` を実行する
public buildCloseElementFrameExpression(string $tagName): string `buildCloseElementFrameExpression()` を実行する
public buildSelfClosingElementFrameExpression(string $tagName, string $attributeVar): string `buildSelfClosingElementFrameExpression()` を実行する
public buildCompiledAttributeStringExpression(array $attributes, string $scopeVar): string `buildCompiledAttributeStringExpression()` を実行する
public buildCompiledAttributeExpressionSegments(array $attributes, string $scopeVar): array `buildCompiledAttributeExpressionSegments()` を実行する
public buildCompiledAttributeStringExpressionFromSegments(array $segments): string `buildCompiledAttributeStringExpressionFromSegments()` を実行する
public buildCombinedOutputExpression(array $segments): string `buildCombinedOutputExpression()` を実行する
public buildOpenElementFrameExpressionFromSegments(string $tagName, array $attributeSegments): string `buildOpenElementFrameExpressionFromSegments()` を実行する
public buildSelfClosingElementFrameExpressionFromSegments(string $tagName, array $attributeSegments, ?string $closingSuffix): string `buildSelfClosingElementFrameExpressionFromSegments()` を実行する
public buildStaticElementLiteral(ElementNode $node): ?string `buildStaticElementLiteral()` を実行する
private buildCompiledValueAttributeExpression(string $name, string $value, string $scopeVar): string `buildCompiledValueAttributeExpression()` を実行する
private buildCompiledAttributeValueExpression(string $value, string $scopeVar): string `buildCompiledAttributeValueExpression()` を実行する
private buildCompiledAttributeValueSegments(string $value, string $scopeVar): array `buildCompiledAttributeValueSegments()` を実行する
private buildStaticAttributeLiteral(array $attributes): ?string `buildStaticAttributeLiteral()` を実行する
private buildElementFrameExpressionFromSegments(string $prefix, array $segments, string $suffix): string `buildElementFrameExpressionFromSegments()` を実行する
private mergeAdjacentCompiledStringLiterals(array $segments): array `mergeAdjacentCompiledStringLiterals()` を実行する
private tryDecodeCompiledStringLiteral(string $expression): ?string `tryDecodeCompiledStringLiteral()` を実行する
private buildStaticNodeLiteral(NodeInterface $node): ?string `buildStaticNodeLiteral()` を実行する
private isHtmlVoidTag(string $tagName): bool `isHtmlVoidTag()` かを返す