类 ConsoleFormatter
用于生成包含 ANSI 转义代码的输出的调试器格式化程序
命名空间: Cake\Error\Debug
属性概述
-
$styles protected
array<string, string>彩色输出中使用的文本颜色。
方法概述
-
dump() public
将 NodeInterface 对象树转换为纯文本字符串。
-
environmentMatches() public static
检查当前环境是否支持 ANSI 输出。
-
export() protected
将 NodeInterface 对象树转换为纯文本字符串。
-
exportArray() protected
导出数组类型对象
-
exportObject() protected
处理对象到字符串的转换。
-
formatWrapper() public
输出带有位置上下文的转储包装器。
-
style() protected
使用 ANSI 转义代码设置文本样式。
方法详情
dump() ¶ public
dump(Cake\Error\Debug\NodeInterface $node): string
将 NodeInterface 对象树转换为纯文本字符串。
参数
-
Cake\Error\Debug\NodeInterface$node 要转储的节点树。
返回值
stringexport() ¶ protected
export(Cake\Error\Debug\NodeInterface $var, int $indent): string
将 NodeInterface 对象树转换为纯文本字符串。
参数
-
Cake\Error\Debug\NodeInterface$var 要转储的节点树。
-
int$indent 当前缩进级别。
返回值
stringexportArray() ¶ protected
exportArray(Cake\Error\Debug\ArrayNode $var, int $indent): string
导出数组类型对象
参数
-
Cake\Error\Debug\ArrayNode$var 要导出的数组。
-
int$indent 当前缩进级别。
返回值
stringexportObject() ¶ protected
exportObject(Cake\Error\Debug\ClassNodeCake\Error\Debug\ReferenceNode $var, int $indent): string
处理对象到字符串的转换。
参数
-
Cake\Error\Debug\ClassNodeCake\Error\Debug\ReferenceNode$var 要转换的对象。
-
int$indent 当前缩进级别。
返回值
string另请参见
\Cake\Error\Debugger::exportVar()
formatWrapper() ¶ public
formatWrapper(string $contents, array $location): string
输出带有位置上下文的转储包装器。
参数
-
string$contents -
array$location
返回值
stringstyle() ¶ protected
style(string $style, string $text): string
使用 ANSI 转义代码设置文本样式。
参数
-
string$style 要使用的样式名称。
-
string$text 要设置样式的文本。
返回值
string