Methods |
public
|
__construct(
?TagFormats $tagFormats = null,
?MessageFormats $messageFormats = null,
(Closure(): (int|null))|null $widthCallback = null,
array<ConsoleInterface::LEVEL_*, string> $levelPrefixMap = Formatter::DEFAULT_LEVEL_PREFIX_MAP,
array<ConsoleInterface::TYPE_*, string> $typePrefixMap = Formatter::DEFAULT_TYPE_PREFIX_MAP,
)
|
#
|
public
|
removesEscapes(): bool
Check if the formatter removes escapes from strings
Check if the formatter removes escapes from strings
Implements
|
#
|
public
|
wrapsAfterFormatting(): bool
Check if the formatter wraps strings after formatting
Check if the formatter wraps strings after formatting
Returns false if strings are wrapped after inline formatting tags are
removed.
Implements
|
#
|
public
|
withRemoveEscapes(bool $remove = true)
Get an instance that removes escapes from strings
Get an instance that removes escapes from strings
Implements
|
#
|
public
|
withWrapAfterFormatting(bool $value = true)
Get an instance that wraps strings after formatting
Get an instance that wraps strings after formatting
Implements
|
#
|
public
|
getTagFormat(int $tag): FormatInterface
Get the format applied to a given tag
Get the format applied to a given tag
Implements
|
#
|
public
|
getMessageFormat(int $level, int $type = ConsoleInterface::TYPE_STANDARD): MessageFormatInterface
Get the format applied to a given message level and type
Get the format applied to a given message level and type
Implements
|
#
|
public
|
getMessagePrefix(int $level, int $type = ConsoleInterface::TYPE_STANDARD): string
Get the prefix applied to a given message level and type
Get the prefix applied to a given message level and type
Implements
|
#
|
public
|
format(string $string, bool $unwrap = false, $wrapTo = null, bool $unformat = false, string $break = "\n"): string
Format and optionally reflow a string with inline formatting tags
Format and optionally reflow a string with inline formatting tags
Parameters
$wrapTo |
int : wrap the string to the
given width
array{int,int} : wrap the string to [ <first_line_width>, <width> ]
null (default): do not wrap the string
|
$unformat |
If true , inline formatting tags are reapplied
after the string is formatted.
|
Implements
|
#
|
public
|
formatDiff(string $diff): string
Format a unified diff
|
#
|
public
|
formatMessage(
string $msg1,
?string $msg2 = null,
int $level = ConsoleInterface::LEVEL_INFO,
int $type = ConsoleInterface::TYPE_STANDARD,
): string
Format a console message
Format a console message
Inline formatting tags in $msg1 and $msg2 have no special meaning;
call {@see format()} first if necessary.
Implements
|
#
|