class Debugger (View source)

A debugging utility class

Properties

static protected ObjectManagerInterface $objectManager
static protected array $renderedObjects
static protected array $ignoredClassesFallback

Hardcoded list of Flow class names (regex) which should not be displayed during debugging.

static protected string $ignoredClassesRegex
static protected int $recursionLimit
static protected int $recursionLimitFallback
static protected string $excludedPropertyNames
static bool $stylesheetEchoed

Is set to true once the CSS file is included in the current page to prevent double inclusions of the CSS file.

Methods

static void
injectObjectManager(ObjectManagerInterface $objectManager)

Injects the Object Manager

static void
clearState()

Clear the state of the debugger

static string
renderDump(mixed $variable, int $level, bool $plaintext = false, bool $ansiColors = false)

Renders a dump of the given variable

static string
renderArrayDump(iterable $array, int $level, bool $plaintext = false, bool $ansiColors = false)

Renders a dump of the given array

static string
renderObjectDump(object $object, int $level, bool $renderProperties = true, bool $plaintext = false, bool $ansiColors = false)

Renders a dump of the given object

static string
getBacktraceCode(array $trace, bool $includeCode = true, bool $plaintext = false)

Renders some backtrace

static string
getBacktraceCodePlaintext(array $trace, bool $includeCode = true)

No description

static string
getCodeSnippet(string $filePathAndName, int $lineNumber, bool $plaintext = false)

Returns a code snippet from the specified file.

static string
getCodeSnippetPlaintext(string $filePathAndName, int $lineNumber)

No description

static array
findProxyAndShortFilePath(string $file)

No description

static string
ansiEscapeWrap(string $string, string $ansiColors, bool $enable = true)

Wrap a string with the ANSI escape sequence for colorful output

static string
getIgnoredClassesRegex()

Tries to load the 'Neos.Flow.error.debugger.ignoredClasses' setting to build a regular expression that can be used to filter ignored class names If settings can't be loaded it uses self::$ignoredClassesFallback.

static int
getRecursionLimit()

Tries to load the 'Neos.Flow.error.debugger.recursionLimit' setting to determine the maximal recursions-level fgor the debugger.

Details

static void injectObjectManager(ObjectManagerInterface $objectManager)

Injects the Object Manager

Parameters

ObjectManagerInterface $objectManager

Return Value

void

static void clearState()

Clear the state of the debugger

Return Value

void

static string renderDump(mixed $variable, int $level, bool $plaintext = false, bool $ansiColors = false)

Renders a dump of the given variable

Parameters

mixed $variable
int $level
bool $plaintext
bool $ansiColors

Return Value

string

static protected string renderArrayDump(iterable $array, int $level, bool $plaintext = false, bool $ansiColors = false)

Renders a dump of the given array

Parameters

iterable $array
int $level
bool $plaintext
bool $ansiColors

Return Value

string

static protected string renderObjectDump(object $object, int $level, bool $renderProperties = true, bool $plaintext = false, bool $ansiColors = false)

Renders a dump of the given object

Parameters

object $object
int $level
bool $renderProperties
bool $plaintext
bool $ansiColors

Return Value

string

static string getBacktraceCode(array $trace, bool $includeCode = true, bool $plaintext = false)

Renders some backtrace

Parameters

array $trace

The trace

bool $includeCode

Include code snippet

bool $plaintext

Return Value

string

Backtrace information

static protected string getBacktraceCodePlaintext(array $trace, bool $includeCode = true)

No description

Parameters

array $trace
bool $includeCode

Return Value

string

static string getCodeSnippet(string $filePathAndName, int $lineNumber, bool $plaintext = false)

Returns a code snippet from the specified file.

Parameters

string $filePathAndName

Absolute path and filename of the PHP file

int $lineNumber

Line number defining the center of the code snippet

bool $plaintext

Return Value

string

The code snippet

static protected string getCodeSnippetPlaintext(string $filePathAndName, int $lineNumber)

No description

Parameters

string $filePathAndName
int $lineNumber

Return Value

string

static array findProxyAndShortFilePath(string $file)

No description

Parameters

string $file

Return Value

array

static protected string ansiEscapeWrap(string $string, string $ansiColors, bool $enable = true)

Wrap a string with the ANSI escape sequence for colorful output

Parameters

string $string

The string to wrap

string $ansiColors

The ansi color sequence (e.g. "1;37")

bool $enable

If false, the raw string will be returned

Return Value

string

The wrapped or raw string

static string getIgnoredClassesRegex()

Tries to load the 'Neos.Flow.error.debugger.ignoredClasses' setting to build a regular expression that can be used to filter ignored class names If settings can't be loaded it uses self::$ignoredClassesFallback.

Return Value

string

static int getRecursionLimit()

Tries to load the 'Neos.Flow.error.debugger.recursionLimit' setting to determine the maximal recursions-level fgor the debugger.

If settings can't be loaded it uses self::$ignoredClassesFallback.

Return Value

int