NaifyView\Dialect\Naify\NaifyValueTransformRuntime クラス

NaifyValueTransformRuntime — Naify dialect の Naify Value Transform Runtime

Native template 構文の parser / evaluator / runtime contract を担当する。 Twig / Smarty 互換文化を混ぜず、Naify として持つ構文 surface をここで固定する。

使用例

// Naify dialect の parser / expression / runtime helper として使う。
// 通常は NaifyParser や compiler/executor から間接的に呼ばれる。

プロパティ

名前型説明
private $filterHandlers array external filter handlers
private $outputValueRuntime NaifyOutputValueRuntime output/stringify contract owner
private $builtInFilterRuntime NaifyBuiltInFilterRuntime built-in filter name dispatcher
private $filterArgumentRuntime NaifyFilterArgumentRuntime filter argument/target normalization owner
private static $hasMbCaseRuntime ?bool
private static $hasMbSliceRuntime ?bool

メソッド

メソッド説明
public __construct(array $filterHandlers = '...', bool $autoEscape = false): void インスタンスを初期化する
public setAutoEscape(bool $autoEscape): void `setAutoEscape()` の値を設定する
public getAutoEscape(): bool `getAutoEscape()` の値を返す
public applyDotFilter(string $filterName, mixed $value, array $arguments = '...'): mixed `applyDotFilter()` を実行する
public applyFilter(string $filterName, mixed $value, array $arguments = '...'): mixed `applyFilter()` を実行する
public filterEscape(mixed $value, mixed $strategy = html): SafeOutputString `filterEscape()` を実行する
public filterLower(mixed $value): string `filterLower()` を実行する
public filterUpper(mixed $value): string `filterUpper()` を実行する
public filterTrim(mixed $value, mixed $mask): string `filterTrim()` を実行する
public filterNl2br(mixed $value): SafeOutputString `filterNl2br()` を実行する
public filterReplace(mixed $value, array $arguments = '...'): string `filterReplace()` を実行する
public filterContains(mixed $value, mixed $needle = ): bool `filterContains()` を実行する
public filterStartsWith(mixed $value, mixed $prefix = ): bool `filterStartsWith()` を実行する
public filterEndsWith(mixed $value, mixed $suffix = ): bool `filterEndsWith()` を実行する
public filterTruncate(mixed $value, array $arguments = '...'): string `filterTruncate()` を実行する
public filterKeys(mixed $value): array `filterKeys()` を実行する
public filterSort(mixed $value): array `filterSort()` を実行する
public filterJoin(mixed $value, mixed $separator = ): string `filterJoin()` を実行する
public filterFirst(mixed $value): mixed `filterFirst()` を実行する
public filterLast(mixed $value): mixed `filterLast()` を実行する
public filterSlice(mixed $value, array $arguments = '...'): mixed `filterSlice()` を実行する
public filterDefault(mixed $value, mixed $fallback): mixed `filterDefault()` を実行する
public filterJsonDecode(mixed $value): mixed `filterJsonDecode()` を実行する
public filterSplit(mixed $value, array $arguments = '...'): array `filterSplit()` を実行する
public filterMerge(mixed $value, mixed $other = '...'): array `filterMerge()` を実行する
public filterUrlEncode(mixed $value): string `filterUrlEncode()` を実行する
public filterJsonEncode(mixed $value): string `filterJsonEncode()` を実行する
public filterToString(mixed $value): string `filterToString()` を実行する
public filterToDate(mixed $value, mixed $format = Y-m-d H:i:s): string `filterToDate()` を実行する
public filterRound(mixed $value, mixed $precision = 0): int|float `filterRound()` を実行する
public filterRaw(mixed $value): SafeOutputString `filterRaw()` を実行する
public filterLength(mixed $value): int `filterLength()` を実行する
public filterIsEmpty(mixed $value): bool `filterIsEmpty()` を実行する
public filterIsDefined(mixed $value): bool `filterIsDefined()` を実行する
private resolveBuiltInFilter(string $filterName, mixed $value, array $arguments): array `resolveBuiltInFilter()` を実行する
private applyExternalFilter(string $filterName, mixed $value, array $arguments): mixed `applyExternalFilter()` を実行する
private resolveExternalFilterHandler(object|array $filterHandler, string $filterName, mixed $value, array $arguments): array `resolveExternalFilterHandler()` を実行する
public stringify(mixed $value): string `stringify()` を実行する
public output(mixed $value): string `output()` を実行する
public expressionOutput(mixed $value): string `expressionOutput()` を実行する
public explicitStringify(mixed $value): string `explicitStringify()` を実行する
public normalizeNumericValue(mixed $value, string $expression): int|float `normalizeNumericValue()` を実行する
private lowercaseValue(mixed $value): string `lowercaseValue()` を実行する
private uppercaseValue(mixed $value): string `uppercaseValue()` を実行する
private trimValue(mixed $value, mixed $mask): string `trimValue()` を実行する
private escapeValue(mixed $value, mixed $strategy = html): string `escapeValue()` を実行する
private nl2brValue(mixed $value): string `nl2brValue()` を実行する
private defaultValue(mixed $value, mixed $fallback): mixed `defaultValue()` を実行する
private isEmptyValue(mixed $value): bool `isEmptyValue()` かを返す
private decodeJsonValue(mixed $value): mixed `decodeJsonValue()` を実行する
private splitValue(mixed $value, array $arguments): array `splitValue()` を実行する
private urlEncodeValue(mixed $value): string `urlEncodeValue()` を実行する
private escapeJsStringValue(string $value): string `escapeJsStringValue()` を実行する
private toDateValue(mixed $value, mixed $format): string `toDateValue()` を実行する
private mergeValues(mixed $value, mixed $other): array `mergeValues()` を実行する
private lengthValue(mixed $value): int `lengthValue()` を実行する
private roundValue(mixed $value, mixed $precision): int|float `roundValue()` を実行する
private replaceValue(mixed $value, array $arguments): string `replaceValue()` を実行する
private containsValue(mixed $value, mixed $needle): bool `containsValue()` を実行する
private startsWithValue(mixed $value, mixed $prefix): bool `startsWithValue()` を実行する
private endsWithValue(mixed $value, mixed $suffix): bool `endsWithValue()` を実行する
private truncateValue(mixed $value, array $arguments): string `truncateValue()` を実行する
private sortValue(mixed $value): array `sortValue()` を実行する
private joinValue(mixed $value, mixed $separator): string `joinValue()` を実行する
private firstValue(mixed $value): mixed `firstValue()` を実行する
private lastValue(mixed $value): mixed `lastValue()` を実行する
private sliceValue(mixed $value, array $arguments): mixed `sliceValue()` を実行する
private normalizeArrayLikeValue(mixed $value, string $surface): array `normalizeArrayLikeValue()` を実行する
private normalizeSliceOffset(mixed $value, string $label): int `normalizeSliceOffset()` を実行する
private measureStringLength(string $value): int `measureStringLength()` を実行する
private sliceStringValue(string $value, int $start, ?int $length): string `sliceStringValue()` を実行する
private normalizeMergeOperand(mixed $value): array `normalizeMergeOperand()` を実行する
private buildDefaultAmbiguousException(mixed $value, string $surface, string $filter = default): NaifyViewException `buildDefaultAmbiguousException()` を実行する
private buildUnknownEscapeStrategyException(string $strategy): NaifyViewException `buildUnknownEscapeStrategyException()` を実行する
private hasMbCaseRuntime(): bool `hasMbCaseRuntime()` かを返す
private hasMbSliceRuntime(): bool `hasMbSliceRuntime()` かを返す
private normalizeDateTimestamp(mixed $value): int `normalizeDateTimestamp()` を実行する