StyledText

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

A line of output as text segments with an optional console style each.

Table of Contents

Constants

STYLE_DIM  : string = 'inspect_dim'
STYLE_ELLIPSIS  : string = 'inspect_ellipsis'
STYLE_KEY  : string = 'inspect_key'
STYLE_MARKER  : string = 'inspect_marker'
STYLE_NULL  : string = 'inspect_null'
STYLE_NUMBER  : string = 'inspect_number'
STYLE_SECRET  : string = 'inspect_secret'
STYLE_STRING  : string = 'inspect_string'

Properties

$segments  : array

Methods

__construct()  : mixed
append()  : self
concat()  : self
format()  : string
plain()  : string
truncate()  : self
Cuts the text so that it fits into $maxWidth including a trailing ellipsis.
width()  : int
withStyle()  : self

Constants

STYLE_DIM

public string STYLE_DIM = 'inspect_dim'

STYLE_ELLIPSIS

public string STYLE_ELLIPSIS = 'inspect_ellipsis'

STYLE_KEY

public string STYLE_KEY = 'inspect_key'

STYLE_MARKER

public string STYLE_MARKER = 'inspect_marker'

STYLE_NULL

public string STYLE_NULL = 'inspect_null'

STYLE_NUMBER

public string STYLE_NUMBER = 'inspect_number'

STYLE_SECRET

public string STYLE_SECRET = 'inspect_secret'

STYLE_STRING

public string STYLE_STRING = 'inspect_string'

Properties

Methods

__construct()

public __construct([array<int, array{string, ?string}> $segments = [] ]) : mixed

Parameters

$segments : array<int, array{string, ?string}> = []

append()

public append(string $text[, string|null $style = null ]) : self

Parameters

$text : string
$style : string|null = null

Return values

self

concat()

public concat(self $other) : self

Parameters

$other : self

Return values

self

format()

public format() : string

Return values

string

plain()

public plain() : string

Return values

string

truncate()

Cuts the text so that it fits into $maxWidth including a trailing ellipsis.

public truncate(int $maxWidth) : self

Parameters

$maxWidth : int

Return values

self

width()

public width() : int

Return values

int

withStyle()

public withStyle(string $from, string $to) : self

Parameters

$from : string
$to : string

Return values

self
On this page