NaifyView\Observation\ErrorMessageCatalog クラス

ErrorMessageCatalog — observation layer の Error Message Catalog

render / compile の状態を人間が追える形で残すための観測部品。 profiler off 時の軽さを保ちつつ、必要な時だけ detail を出せるようにする。

使用例

// Profiler::global()->checkpointNaifyView('label') で観測点を残す。
// off 時は軽く、debug 時だけ詳細 trace を持つ。

メソッド

メソッド説明
public static hasTemplate(string $messageKey, string $locale = ja): bool 指定localeまたは既定localeにmessage templateが存在するかを返す。
public static format(string $messageKey, array $payload = '...', string $locale = ja, ?string $fallbackMessage): string 登録済みtemplateだけを補間する。未登録時の原文にはpayloadを適用しない。
public static buildLocalizedMessages(string $messageKey, array $payload = '...', array $locales = '...', ?string $fallbackMessage): array `buildLocalizedMessages()` を実行する
private static resolveTemplate(string $messageKey, string $locale): ?string `resolveTemplate()` を実行する
private static normalizeLocale(string $locale): string `normalizeLocale()` を実行する
private static interpolateTemplate(string $template, array $payload): string `interpolateTemplate()` を実行する
private static stringifyValue(mixed $value): string `stringifyValue()` を実行する