NaifyView\Compiler\CompiledClassMethodSourceBuilder クラス

CompiledClassMethodSourceBuilder — compiled mainline の Compiled Class Method Source Builder

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

使用例

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

プロパティ

名前型説明
private $compileLevel string generated PHP readability / exposure level

メソッド

メソッド説明
public __construct(string $compileLevel = debug): void インスタンスを初期化する
public buildCompiledTemplateMethodSource(array $templateEntry): array `buildCompiledTemplateMethodSource()` を実行する
public buildCompiledMacroMethodSource(array $macroEntry): array `buildCompiledMacroMethodSource()` を実行する
private buildMacroRegistryLines(array $bindings): array Bind this template's macros into render-local state, retaining their defining artifact.
private buildMethodDocblockLines(array $body): array
private buildTemplateCommentLines(string $templatePath, string $source): array `buildTemplateCommentLines()` を実行する
private buildMacroCommentLines(array $macroEntry): array `buildMacroCommentLines()` を実行する
private normalizeCompileLevel(string $compileLevel): string `normalizeCompileLevel()` を実行する
private buildContextLocalReadLines(bool $usesScope, bool $usesState, bool $usesSlotOverrides): array `buildContextLocalReadLines()` を実行する
private bodyUsesVariable(array $bodyLines, string $needle): bool `bodyUsesVariable()` を実行する