From d3c0831e56cb84fd214f01bb591f2f632b5cb941 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Mon, 1 Aug 2022 07:53:40 -0700 Subject: [PATCH] Clean up some logic for readability --- class.krumo.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/class.krumo.php b/class.krumo.php index c83a6f7..db24df3 100644 --- a/class.krumo.php +++ b/class.krumo.php @@ -499,9 +499,12 @@ public static function dump($data, $second = '') $_ = debug_backtrace(); while ($d = array_pop($_)) { $callback = static::$lineNumberTestCallback; - $class = strtolower($d['class'] ?? ''); - $function = strtolower($d['function'] ?? ''); - if (in_array($function, array('krumo','k','kd')) || $class == 'krumo' || (is_callable($callback) && call_user_func($callback, $d))) { + + $class = strtolower($d['class'] ?? ''); + $function = strtolower($d['function'] ?? ''); + $is_krumo_func = in_array($function, array('krumo','k','kd')); + + if ($is_krumo_func || $class == 'krumo' || (is_callable($callback) && call_user_func($callback, $d))) { break; } }