Class ConsoleFormatter
A Debugger formatter for generating output with ANSI escape codes
Property Summary
- 
        $styles protectedarray<string, string>text colors used in colored output. 
Method Summary
- 
          dump() publicConvert a tree of NodeInterface objects into a plain text string. 
- 
          environmentMatches() public staticCheck if the current environment supports ANSI output. 
- 
          export() protectedConvert a tree of NodeInterface objects into a plain text string. 
- 
          exportArray() protectedExport an array type object 
- 
          exportObject() protectedHandles object to string conversion. 
- 
          formatWrapper() publicOutput a dump wrapper with location context. 
- 
          style() protectedStyle text with ANSI escape codes. 
Method Detail
dump() ¶ public
dump(Cake\Error\Debug\NodeInterface $node): stringConvert a tree of NodeInterface objects into a plain text string.
Parameters
- 
                Cake\Error\Debug\NodeInterface$node
- The node tree to dump. 
Returns
stringenvironmentMatches() ¶ public static
environmentMatches(): boolCheck if the current environment supports ANSI output.
Returns
boolexport() ¶ protected
export(Cake\Error\Debug\NodeInterface $var, int $indent): stringConvert a tree of NodeInterface objects into a plain text string.
Parameters
- 
                Cake\Error\Debug\NodeInterface$var
- The node tree to dump. 
- 
                int$indent
- The current indentation level. 
Returns
stringexportArray() ¶ protected
exportArray(Cake\Error\Debug\ArrayNode $var, int $indent): stringExport an array type object
Parameters
- 
                Cake\Error\Debug\ArrayNode$var
- The array to export. 
- 
                int$indent
- The current indentation level. 
Returns
stringExported array.
exportObject() ¶ protected
exportObject(Cake\Error\Debug\ClassNode|Cake\Error\Debug\ReferenceNode $var, int $indent): stringHandles object to string conversion.
Parameters
- 
                Cake\Error\Debug\ClassNode|Cake\Error\Debug\ReferenceNode$var
- Object to convert. 
- 
                int$indent
- Current indentation level. 
Returns
stringSee Also
formatWrapper() ¶ public
formatWrapper(string $contents, array $location): stringOutput a dump wrapper with location context.
Parameters
- 
                string$contents
- 
                array$location
Returns
stringstyle() ¶ protected
style(string $style, string $text): stringStyle text with ANSI escape codes.
Parameters
- 
                string$style
- The style name to use. 
- 
                string$text
- The text to style. 
Returns
stringThe styled output.
