Class ConsoleFormatter

A Debugger formatter for generating output with ANSI escape codes

Namespace: Cake\Error\Debug

Properties summary

  • $styles protected
    array

    text colors used in colored output.

Method Summary

  • dump() public

    Convert a tree of NodeInterface objects into a plain text string.

  • environmentMatches() public static

    Check if the current environment supports ANSI output.

  • export() protected

    Convert a tree of NodeInterface objects into a plain text string.

  • exportArray() protected

    Export an array type object

  • exportObject() protected

    Handles object to string conversion.

  • formatWrapper() public

    Output a dump wrapper with location context.

  • style() protected

    Style text with ANSI escape codes.

Method Detail

dump() public

dump(\Cake\Error\Debug\NodeInterface $node)

Convert a tree of NodeInterface objects into a plain text string.

Parameters

\Cake\Error\Debug\NodeInterface $node

The node tree to dump.

Returns

string

environmentMatches() public static

environmentMatches()

Check if the current environment supports ANSI output.

Returns

bool

export() protected

export(\Cake\Error\Debug\NodeInterface $var, int $indent)

Convert 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

string

exportArray() protected

exportArray(\Cake\Error\Debug\ArrayNode $var, int $indent)

Export an array type object

Parameters

\Cake\Error\Debug\ArrayNode $var

The array to export.

int $indent

The current indentation level.

Returns

string

Exported array.

exportObject() protected

exportObject(mixed $var, int $indent)

Handles object to string conversion.

Parameters

\Cake\Error\Debug\ClassNode|\Cake\Error\Debug\ReferenceNode $var

Object to convert.

int $indent

Current indentation level.

Returns

string

See Also

\Cake\Error\Debugger::exportVar()

formatWrapper() public

formatWrapper(string $contents, array $location)

Output a dump wrapper with location context.

Parameters

string $contents

The contents to wrap and return

array $location

The file and line the contents came from.

Returns

string

style() protected

style(string $style, string $text)

Style text with ANSI escape codes.

Parameters

string $style

The style name to use.

string $text

The text to style.

Returns

string

The styled output.

Property Detail

$styles protected

text colors used in colored output.

Type

array

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Error.Debug.ConsoleFormatter.html