NaifyView\Compiler\CompiledExpressionPathFastPathBuilder クラス

CompiledExpressionPathFastPathBuilder — compiled mainline の Compiled Expression Path Fast Path Builder

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

使用例

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

プロパティ

名前型説明
private $resolveFastValueExpression Closure ?string
private $buildMixedListLiteral Closure string
private $findMatchingBracket Closure ?int
private $expressionEvaluator NaifyExpressionEvaluator

メソッド

メソッド説明
public __construct(NaifyExpressionEvaluator $expressionEvaluator, Closure $resolveFastValueExpression, Closure $buildMixedListLiteral, Closure $findMatchingBracket): void インスタンスを初期化する
public resolvePathPlanExpression(string $expression, string $scopeVar): ?string `resolvePathPlanExpression()` を実行する
public resolvePathValueWithExistenceExpression(string $expression, string $scopeVar): ?string Read both null/missing state and the value in one traversal.
public resolvePathExistsExpression(string $expression, string $scopeVar): ?string `resolvePathExistsExpression()` を実行する
private guardTrustedPathExpression(string $rootToken, string $expression, string $compiled, string $scopeVar): string Check the grant before any root getter or dynamic index is evaluated.
public isPurePathExpressionForOutput(string $expression): bool `isPurePathExpressionForOutput()` かを返す
private buildCompiledPathSegments(mixed $steps, string $scopeVar): ?array `buildCompiledPathSegments()` を実行する
private buildDirectRootPathExpression(string $scopeVar, string $rootKey, array $compiledSegments): ?string `buildDirectRootPathExpression()` を実行する
private isPurePathExpression(string $expression): bool `isPurePathExpression()` かを返す
private isProtectedInputKey(string $key): bool `isProtectedInputKey()` かを返す