diff --git a/TracyDebugger.module.php b/TracyDebugger.module.php index b8e770d..955d4cf 100644 --- a/TracyDebugger.module.php +++ b/TracyDebugger.module.php @@ -27,7 +27,7 @@ public static function getModuleInfo() { 'summary' => __('Tracy debugger from Nette with many PW specific custom tools.', __FILE__), 'author' => 'Adrian Jones', 'href' => 'https://processwire.com/talk/forum/58-tracy-debugger/', - 'version' => '4.26.43', + 'version' => '4.26.44', 'autoload' => 100000, // in PW 3.0.114+ higher numbers are loaded first - we want Tracy first 'singular' => true, 'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4', diff --git a/includes/ShortcutMethods.php b/includes/ShortcutMethods.php index 2d65655..515c886 100644 --- a/includes/ShortcutMethods.php +++ b/includes/ShortcutMethods.php @@ -20,7 +20,7 @@ function tracyUnavailable() { * @tracySkipLocation */ if(!function_exists('debugAll') && in_array('debugAll', $this->data['enabledShortcutMethods'])) { - function debugAll($var, $title = NULL, array $options = NULL) { + function debugAll($var, $title = NULL, $options = []) { if(tracyUnavailable()) return false; return TD::debugAll($var, $title, $options); } @@ -31,7 +31,7 @@ function debugAll($var, $title = NULL, array $options = NULL) { * @tracySkipLocation */ if(!function_exists('barDump') && in_array('barDump', $this->data['enabledShortcutMethods'])) { - function barDump($var, $title = NULL, array $options = NULL) { + function barDump($var, $title = NULL, $options = []) { if(tracyUnavailable() && !\TracyDebugger::getDataValue('recordGuestDumps')) return false; return TD::barDump($var, $title, $options); } @@ -53,7 +53,7 @@ function barDumpBig($var, $title = NULL) { * @tracySkipLocation */ if(!function_exists('dump') && in_array('dump', $this->data['enabledShortcutMethods'])) { - function dump($var, $title = NULL, array $options = NULL) { + function dump($var, $title = NULL, $options = []) { if(tracyUnavailable() && PHP_SAPI !== 'cli') return false; return TD::dump($var, $title, $options); } @@ -64,7 +64,7 @@ function dump($var, $title = NULL, array $options = NULL) { * @tracySkipLocation */ if(!function_exists('dumpBig') && in_array('dumpBig', $this->data['enabledShortcutMethods'])) { - function dumpBig($var, $title = NULL, array $options = NULL) { + function dumpBig($var, $title = NULL, $options = []) { if(tracyUnavailable() && PHP_SAPI !== 'cli') return false; return TD::dumpBig($var, $title, $options); } @@ -136,7 +136,7 @@ function templateVars($vars) { * @tracySkipLocation */ if(!function_exists('da') && in_array('da', $this->data['enabledShortcutMethods'])) { - function da($var, $title = NULL, array $options = NULL) { + function da($var, $title = NULL, $options = []) { if(tracyUnavailable()) return false; return TD::debugAll($var, $title, $options); } @@ -147,7 +147,7 @@ function da($var, $title = NULL, array $options = NULL) { * @tracySkipLocation */ if(!function_exists('bd') && in_array('bd', $this->data['enabledShortcutMethods'])) { - function bd($var, $title = NULL, array $options = NULL) { + function bd($var, $title = NULL, $options = []) { if(tracyUnavailable() && !\TracyDebugger::getDataValue('recordGuestDumps')) return false; return TD::barDump($var, $title, $options); } @@ -169,7 +169,7 @@ function bdb($var, $title = NULL) { * @tracySkipLocation */ if(!function_exists('d') && in_array('d', $this->data['enabledShortcutMethods'])) { - function d($var, $title = NULL, array $options = NULL) { + function d($var, $title = NULL, $options = []) { if(tracyUnavailable() && PHP_SAPI !== 'cli') return false; return TD::dump($var, $title, $options); } @@ -180,7 +180,7 @@ function d($var, $title = NULL, array $options = NULL) { * @tracySkipLocation */ if(!function_exists('db') && in_array('db', $this->data['enabledShortcutMethods'])) { - function db($var, $title = NULL, array $options = NULL) { + function db($var, $title = NULL, $options = []) { if(tracyUnavailable() && PHP_SAPI !== 'cli') return false; return TD::dumpBig($var, $title, $options); } diff --git a/includes/TD.php b/includes/TD.php index 2c019bc..8d968fd 100644 --- a/includes/TD.php +++ b/includes/TD.php @@ -37,7 +37,7 @@ protected static function tracyUnavailable() { * Tracy\Debugger::debugAll() shortcut. * @tracySkipLocation */ - public static function debugAll($var, string|array|null $title = NULL, ?array $options = NULL) { + public static function debugAll($var, $title = NULL, $options = []) { if(self::tracyUnavailable()) return false; static::barDump($var, $title, $options); static::dump($var, $title, $options); @@ -51,7 +51,7 @@ public static function debugAll($var, string|array|null $title = NULL, ?array $o * Tracy\Debugger::barEcho() shortcut. * @tracySkipLocation */ - public static function barEcho(string $str, string|array|null $title = null) { + public static function barEcho($str, $title = null) { if(self::tracyUnavailable() && !\TracyDebugger::getDataValue('recordGuestDumps')) return false; static::dumpToBar($str, $title, null, true); } @@ -60,7 +60,7 @@ public static function barEcho(string $str, string|array|null $title = null) { * Tracy\Debugger::barDump() shortcut. * @tracySkipLocation */ - public static function barDump($var, string|array|null $title = NULL, ?array $options = NULL) { + public static function barDump($var, $title = NULL, $options = []) { if(self::tracyUnavailable() && !\TracyDebugger::getDataValue('recordGuestDumps')) return false; if(is_array($title)) { $options = $title; @@ -85,7 +85,7 @@ public static function barDump($var, string|array|null $title = NULL, ?array $op * Tracy\Debugger::barDumpBig() shortcut dumping with maxDepth = 6, maxLength = 9999, and maxItems = 250. * @tracySkipLocation */ - public static function barDumpBig($var, string|array|null $title = NULL, ?array $options = NULL) { + public static function barDumpBig($var, $title = NULL, $options = []) { if(self::tracyUnavailable() && !\TracyDebugger::getDataValue('recordGuestDumps')) return false; if(is_array($title)) { $options = $title; @@ -108,7 +108,7 @@ public static function barDumpBig($var, string|array|null $title = NULL, ?array * Tracy\Debugger::dump() shortcut. * @tracySkipLocation */ - public static function dump($var, string|array|null $title = NULL, ?array $options = NULL) { + public static function dump($var, $title = NULL, $options = []) { if(self::tracyUnavailable() && PHP_SAPI !== 'cli') return false; if(is_array($title)) { $options = $title; @@ -153,7 +153,7 @@ public static function dump($var, string|array|null $title = NULL, ?array $optio * Tracy\Debugger::dumpBig() shortcut dumping with maxDepth = 6, maxLength = 9999 and maxItems = 250. * @tracySkipLocation */ - public static function dumpBig($var, string|array|null $title = NULL, ?array $options = NULL) { + public static function dumpBig($var, $title = NULL, $options = []) { if(self::tracyUnavailable() && PHP_SAPI !== 'cli') return false; if(is_array($title)) { $options = $title; @@ -196,7 +196,7 @@ public static function dumpBig($var, string|array|null $title = NULL, ?array $op * Send content to dump bar * @tracySkipLocation */ - private static function dumpToBar($var, string|array|null $title = NULL, ?array $options = NULL, $echo = false) { + private static function dumpToBar($var, $title = NULL, $options = [], $echo = false) { $dumpItem = array(); $dumpItem['title'] = $title; $dumpItem['dump'] = $echo ? '