Browse Source

Further improvements to check for output throwable time in PlainTextHandler

main v2.1.4
Dustin Wilson 4 months ago
parent
commit
e5ee73841c
  1. 5
      lib/Catcher/PlainTextHandler.php

5
lib/Catcher/PlainTextHandler.php

@ -68,7 +68,8 @@ class PlainTextHandler extends Handler {
$method = "{$frame['errorType']} ({$frame['class']})"; $method = "{$frame['errorType']} ({$frame['class']})";
} elseif (isset($frame['function'])) { } elseif (isset($frame['function'])) {
if (str_contains($frame['function'], '{closure}')) { if (str_contains($frame['function'], '{closure}')) {
$method = "{$frame['function']}()"; // We have no way of automatically testing this
$method = "{$frame['function']}()"; // @codeCoverageIgnore
} else { } else {
$ref = new \ReflectionMethod($frame['class'], $frame['function']); $ref = new \ReflectionMethod($frame['class'], $frame['function']);
$method .= (($ref->isStatic()) ? '::' : '->') . $frame['function'] . '()'; $method .= (($ref->isStatic()) ? '::' : '->') . $frame['function'] . '()';
@ -83,7 +84,7 @@ class PlainTextHandler extends Handler {
$frame['line'] $frame['line']
); );
if (isset($frame['args']) && $this->_backtraceArgFrameLimit > $key) { if (isset($frame['args']) && count($frame['args']) > 0 && $this->_backtraceArgFrameLimit > $key) {
$output .= preg_replace('/^/m', "$indent| ", $this->serializeArgs($frame['args'])) . \PHP_EOL; $output .= preg_replace('/^/m', "$indent| ", $this->serializeArgs($frame['args'])) . \PHP_EOL;
} }
} }

Loading…
Cancel
Save