From 932988923547b86c879268fab894f3df85e9e2ea Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sat, 30 Nov 2019 23:34:25 +0100 Subject: [PATCH] Fixed LegacyDevelopment Exception handler to produce less verbose output --- src/Exceptions/Handlers/LegacyDevelopment.php | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/Exceptions/Handlers/LegacyDevelopment.php b/src/Exceptions/Handlers/LegacyDevelopment.php index d6a11949..34c52571 100644 --- a/src/Exceptions/Handlers/LegacyDevelopment.php +++ b/src/Exceptions/Handlers/LegacyDevelopment.php @@ -50,9 +50,33 @@ class LegacyDevelopment extends Legacy $functionName = $trace['function']; + $args = []; + foreach (($trace['args'] ?? []) as $arg) { + // @codeCoverageIgnoreStart + switch (gettype($arg)) { + case 'string': + case 'integer': + case 'double': + $args[] = $arg; + break; + case 'boolean': + $args[] = $arg ? 'true' : 'false'; + break; + case 'object': + $args[] = get_class($arg); + break; + case 'resource': + $args[] = get_resource_type($arg); + break; + default: + $args[] = gettype($arg); + // @codeCoverageIgnoreEnd + } + } + $return[] = [ 'file' => $path . ':' . $line, - $functionName => $trace['args'] ?? null, + $functionName => $args ?? null, ]; }