ValueFormatter

final readonly class \TYPO3\CMS\Lowlevel\Inspector\ValueFormatter

Writes keys and values of normalized data: values as JSON, markers unquoted, keys as shell-quoted path segments that can be pasted back as arguments.

Table of Contents

Methods

countResolvedLabels()  : int
escapeUnsafeCharacters()  : string
Replaces unsafe characters in text that is not JSON by \uXXXX, as JSON escapes them.
inline()  : StyledText
A whole subtree on one line, as JSON with markers unquoted. Stops once the text is wider than $limit, so a preview of a large subtree doesn't encode all of it.
isLeaf()  : bool
json()  : string
Pretty-printed JSON with unsafe characters escaped.
keys()  : StyledText
quote()  : string
toPlainData()  : mixed
Normalized data as plain PHP data for JSON: markers and resolved labels become strings.
value()  : StyledText
A single value: a scalar, a marker, a resolved label or an empty array.

Methods

countResolvedLabels()

public countResolvedLabels(mixed $value) : int

Parameters

$value : mixed

Return values

int

escapeUnsafeCharacters()

Replaces unsafe characters in text that is not JSON by \uXXXX, as JSON escapes them.

public escapeUnsafeCharacters(string $text) : string

Parameters

$text : string

Return values

string

inline()

A whole subtree on one line, as JSON with markers unquoted. Stops once the text is wider than $limit, so a preview of a large subtree doesn't encode all of it.

public inline(array $value[, int $limit = PHP_INT_MAX ]) : StyledText

Parameters

$value : array
$limit : int = PHP_INT_MAX

Return values

StyledText

isLeaf()

public isLeaf(mixed $value) : bool

Parameters

$value : mixed

Return values

bool

json()

Pretty-printed JSON with unsafe characters escaped.

public json(mixed $data) : string

Parameters

$data : mixed

Return values

string

quote()

public quote(string|int $segment) : string

Parameters

$segment : string|int

Return values

string

toPlainData()

Normalized data as plain PHP data for JSON: markers and resolved labels become strings.

public toPlainData(mixed $value) : mixed

Parameters

$value : mixed

value()

A single value: a scalar, a marker, a resolved label or an empty array.

public value(mixed $value) : StyledText

Parameters

$value : mixed

Return values

StyledText
On this page