Methods |
public
|
__construct(
?ConsoleTagFormats $tagFormats = null,
?ConsoleMessageFormats $messageFormats = null,
(callable(): (int|null))|null $widthCallback = null,
array<MessageLevel::*, string> $levelPrefixMap = ConsoleFormatter::DEFAULT_LEVEL_PREFIX_MAP,
array<ConsoleMessageType::*, string> $typePrefixMap = ConsoleFormatter::DEFAULT_TYPE_PREFIX_MAP,
)
|
#
|
public
|
withSpinnerState(?array &$state)
Get an instance with the given spinner state array
Get an instance with the given spinner state array
Implements
|
#
|
public
|
withUnescape(bool $value = true)
Get an instance that unescapes text
Get an instance that unescapes text
Implements
|
#
|
public
|
withWrapAfterApply(bool $value = true)
Get an instance that wraps text after formatting
Get an instance that wraps text after formatting
Implements
|
#
|
public
|
getTagFormat($tag): ConsoleFormatInterface
Get the format applied to a tag
Get the format applied to a tag
Implements
|
#
|
public
|
getMessageFormat($level, $type = ConsoleMessageType::STANDARD): ConsoleMessageFormat
Get the format applied to a message level and type
Get the format applied to a message level and type
Implements
|
#
|
public
|
getUnescape(): bool
Check if text is unescaped
Check if text is unescaped
Implements
|
#
|
public
|
getWrapAfterApply(): bool
Check if text is wrapped after formatting
Check if text is wrapped after formatting
Implements
|
#
|
public
|
getMessagePrefix($level, $type = ConsoleMessageType::STANDARD): string
Get the prefix applied to a message level and type
Get the prefix applied to a message level and type
Implements
|
#
|
public
|
format(string $string, bool $unwrap = false, $wrapToWidth = null, bool $unformat = false, string $break = "\n"): string
Format a string that may contain inline formatting tags
Format a string that may contain inline formatting tags
Paragraphs outside preformatted blocks are optionally wrapped to a given
width, and backslash-escaped punctuation characters and line breaks are
preserved.
Escaped line breaks may have a leading space, so the following are
equivalent:
Text with a \
hard line break.
Text with a\
hard line break.
Parameters
$wrapToWidth |
If null (the default), text
is not wrapped.
|
$unformat |
If true , formatting tags are reapplied after text
is unwrapped and/or wrapped.
|
Implements
|
#
|
public
|
formatMessage(
string $msg1,
?string $msg2 = null,
$level = MessageLevel::INFO,
$type = ConsoleMessageType::STANDARD,
): string
Format a console message
|
#
|
public
|
formatDiff(string $diff): string
Format a unified diff
|
#
|
public
static
|
escapeTags(string $string, bool $newlines = false): string
Escape special characters, optionally including newlines, in a string
Escape special characters, optionally including newlines, in a string
|
#
|
public
static
|
unescapeTags(string $string): string
Unescape special characters in a string
Unescape special characters in a string
|
#
|
public
static
|
removeTags(string $string): string
Remove inline formatting tags from a string
Remove inline formatting tags from a string
|
#
|