Skip to content

Commit 1498869

Browse files
committed
Redo fixes for "Implicitly marking parameter as nullable is deprecated" to support older versions of PHP
1 parent 29d93cd commit 1498869

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

TracyDebugger.module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function getModuleInfo() {
2727
'summary' => __('Tracy debugger from Nette with many PW specific custom tools.', __FILE__),
2828
'author' => 'Adrian Jones',
2929
'href' => 'https://processwire.com/talk/forum/58-tracy-debugger/',
30-
'version' => '4.26.43',
30+
'version' => '4.26.44',
3131
'autoload' => 100000, // in PW 3.0.114+ higher numbers are loaded first - we want Tracy first
3232
'singular' => true,
3333
'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4',

includes/ShortcutMethods.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function tracyUnavailable() {
2020
* @tracySkipLocation
2121
*/
2222
if(!function_exists('debugAll') && in_array('debugAll', $this->data['enabledShortcutMethods'])) {
23-
function debugAll($var, $title = NULL, array $options = NULL) {
23+
function debugAll($var, $title = NULL, $options = []) {
2424
if(tracyUnavailable()) return false;
2525
return TD::debugAll($var, $title, $options);
2626
}
@@ -31,7 +31,7 @@ function debugAll($var, $title = NULL, array $options = NULL) {
3131
* @tracySkipLocation
3232
*/
3333
if(!function_exists('barDump') && in_array('barDump', $this->data['enabledShortcutMethods'])) {
34-
function barDump($var, $title = NULL, array $options = NULL) {
34+
function barDump($var, $title = NULL, $options = []) {
3535
if(tracyUnavailable() && !\TracyDebugger::getDataValue('recordGuestDumps')) return false;
3636
return TD::barDump($var, $title, $options);
3737
}
@@ -53,7 +53,7 @@ function barDumpBig($var, $title = NULL) {
5353
* @tracySkipLocation
5454
*/
5555
if(!function_exists('dump') && in_array('dump', $this->data['enabledShortcutMethods'])) {
56-
function dump($var, $title = NULL, array $options = NULL) {
56+
function dump($var, $title = NULL, $options = []) {
5757
if(tracyUnavailable() && PHP_SAPI !== 'cli') return false;
5858
return TD::dump($var, $title, $options);
5959
}
@@ -64,7 +64,7 @@ function dump($var, $title = NULL, array $options = NULL) {
6464
* @tracySkipLocation
6565
*/
6666
if(!function_exists('dumpBig') && in_array('dumpBig', $this->data['enabledShortcutMethods'])) {
67-
function dumpBig($var, $title = NULL, array $options = NULL) {
67+
function dumpBig($var, $title = NULL, $options = []) {
6868
if(tracyUnavailable() && PHP_SAPI !== 'cli') return false;
6969
return TD::dumpBig($var, $title, $options);
7070
}
@@ -136,7 +136,7 @@ function templateVars($vars) {
136136
* @tracySkipLocation
137137
*/
138138
if(!function_exists('da') && in_array('da', $this->data['enabledShortcutMethods'])) {
139-
function da($var, $title = NULL, array $options = NULL) {
139+
function da($var, $title = NULL, $options = []) {
140140
if(tracyUnavailable()) return false;
141141
return TD::debugAll($var, $title, $options);
142142
}
@@ -147,7 +147,7 @@ function da($var, $title = NULL, array $options = NULL) {
147147
* @tracySkipLocation
148148
*/
149149
if(!function_exists('bd') && in_array('bd', $this->data['enabledShortcutMethods'])) {
150-
function bd($var, $title = NULL, array $options = NULL) {
150+
function bd($var, $title = NULL, $options = []) {
151151
if(tracyUnavailable() && !\TracyDebugger::getDataValue('recordGuestDumps')) return false;
152152
return TD::barDump($var, $title, $options);
153153
}
@@ -169,7 +169,7 @@ function bdb($var, $title = NULL) {
169169
* @tracySkipLocation
170170
*/
171171
if(!function_exists('d') && in_array('d', $this->data['enabledShortcutMethods'])) {
172-
function d($var, $title = NULL, array $options = NULL) {
172+
function d($var, $title = NULL, $options = []) {
173173
if(tracyUnavailable() && PHP_SAPI !== 'cli') return false;
174174
return TD::dump($var, $title, $options);
175175
}
@@ -180,7 +180,7 @@ function d($var, $title = NULL, array $options = NULL) {
180180
* @tracySkipLocation
181181
*/
182182
if(!function_exists('db') && in_array('db', $this->data['enabledShortcutMethods'])) {
183-
function db($var, $title = NULL, array $options = NULL) {
183+
function db($var, $title = NULL, $options = []) {
184184
if(tracyUnavailable() && PHP_SAPI !== 'cli') return false;
185185
return TD::dumpBig($var, $title, $options);
186186
}

includes/TD.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected static function tracyUnavailable() {
3737
* Tracy\Debugger::debugAll() shortcut.
3838
* @tracySkipLocation
3939
*/
40-
public static function debugAll($var, string|array|null $title = NULL, ?array $options = NULL) {
40+
public static function debugAll($var, $title = NULL, $options = []) {
4141
if(self::tracyUnavailable()) return false;
4242
static::barDump($var, $title, $options);
4343
static::dump($var, $title, $options);
@@ -51,7 +51,7 @@ public static function debugAll($var, string|array|null $title = NULL, ?array $o
5151
* Tracy\Debugger::barEcho() shortcut.
5252
* @tracySkipLocation
5353
*/
54-
public static function barEcho(string $str, string|array|null $title = null) {
54+
public static function barEcho($str, $title = null) {
5555
if(self::tracyUnavailable() && !\TracyDebugger::getDataValue('recordGuestDumps')) return false;
5656
static::dumpToBar($str, $title, null, true);
5757
}
@@ -60,7 +60,7 @@ public static function barEcho(string $str, string|array|null $title = null) {
6060
* Tracy\Debugger::barDump() shortcut.
6161
* @tracySkipLocation
6262
*/
63-
public static function barDump($var, string|array|null $title = NULL, ?array $options = NULL) {
63+
public static function barDump($var, $title = NULL, $options = []) {
6464
if(self::tracyUnavailable() && !\TracyDebugger::getDataValue('recordGuestDumps')) return false;
6565
if(is_array($title)) {
6666
$options = $title;
@@ -85,7 +85,7 @@ public static function barDump($var, string|array|null $title = NULL, ?array $op
8585
* Tracy\Debugger::barDumpBig() shortcut dumping with maxDepth = 6, maxLength = 9999, and maxItems = 250.
8686
* @tracySkipLocation
8787
*/
88-
public static function barDumpBig($var, string|array|null $title = NULL, ?array $options = NULL) {
88+
public static function barDumpBig($var, $title = NULL, $options = []) {
8989
if(self::tracyUnavailable() && !\TracyDebugger::getDataValue('recordGuestDumps')) return false;
9090
if(is_array($title)) {
9191
$options = $title;
@@ -108,7 +108,7 @@ public static function barDumpBig($var, string|array|null $title = NULL, ?array
108108
* Tracy\Debugger::dump() shortcut.
109109
* @tracySkipLocation
110110
*/
111-
public static function dump($var, string|array|null $title = NULL, ?array $options = NULL) {
111+
public static function dump($var, $title = NULL, $options = []) {
112112
if(self::tracyUnavailable() && PHP_SAPI !== 'cli') return false;
113113
if(is_array($title)) {
114114
$options = $title;
@@ -153,7 +153,7 @@ public static function dump($var, string|array|null $title = NULL, ?array $optio
153153
* Tracy\Debugger::dumpBig() shortcut dumping with maxDepth = 6, maxLength = 9999 and maxItems = 250.
154154
* @tracySkipLocation
155155
*/
156-
public static function dumpBig($var, string|array|null $title = NULL, ?array $options = NULL) {
156+
public static function dumpBig($var, $title = NULL, $options = []) {
157157
if(self::tracyUnavailable() && PHP_SAPI !== 'cli') return false;
158158
if(is_array($title)) {
159159
$options = $title;
@@ -196,7 +196,7 @@ public static function dumpBig($var, string|array|null $title = NULL, ?array $op
196196
* Send content to dump bar
197197
* @tracySkipLocation
198198
*/
199-
private static function dumpToBar($var, string|array|null $title = NULL, ?array $options = NULL, $echo = false) {
199+
private static function dumpToBar($var, $title = NULL, $options = [], $echo = false) {
200200
$dumpItem = array();
201201
$dumpItem['title'] = $title;
202202
$dumpItem['dump'] = $echo ? '<div class="tracy-echo">' . $var . '</div>' : static::generateDump($var, $options);
@@ -214,7 +214,7 @@ private static function dumpToBar($var, string|array|null $title = NULL, ?array
214214
* Generate debugInfo and Full Object tabbed output
215215
* @tracySkipLocation
216216
*/
217-
private static function generateDump($var, array $options) {
217+
private static function generateDump($var, $options) {
218218
// standard options for all dump/barDump variations
219219
$options[Dumper::COLLAPSE] = isset($options['collapse']) ? $options['collapse'] : \TracyDebugger::getDataValue('collapse');
220220
$options[Dumper::COLLAPSE_COUNT] = isset($options['collapse_count']) ? $options['collapse_count'] : \TracyDebugger::getDataValue('collapse_count');
@@ -341,7 +341,7 @@ private static function generateEditViewLinks($var, $type, $section) {
341341
* Tracy\Debugger::log() shortcut.
342342
* @tracySkipLocation
343343
*/
344-
public static function log(string $message, $priority = Debugger::INFO) {
344+
public static function log($message, $priority = Debugger::INFO) {
345345
if(self::tracyUnavailable()) return false;
346346
return Debugger::log($message, $priority);
347347
}
@@ -350,7 +350,7 @@ public static function log(string $message, $priority = Debugger::INFO) {
350350
* Tracy\Debugger::timer() shortcut.
351351
* @tracySkipLocation
352352
*/
353-
public static function timer(?string $name = NULL) {
353+
public static function timer($name = NULL) {
354354
if(self::tracyUnavailable()) return false;
355355
$roundedTime = round(Debugger::timer($name),4);
356356
if($name) {
@@ -365,7 +365,7 @@ public static function timer(?string $name = NULL) {
365365
* Tracy\Debugger::fireLog() shortcut.
366366
* @tracySkipLocation
367367
*/
368-
public static function fireLog(?string $message = NULL) {
368+
public static function fireLog($message = NULL) {
369369
if(!method_exists('Tracy\Debugger', 'getFireLogger') || self::tracyUnavailable()) return false;
370370
return Debugger::fireLog($message);
371371
}
@@ -375,7 +375,7 @@ public static function fireLog(?string $message = NULL) {
375375
* Zarganwar\PerformancePanel\Register::add() shortcut.
376376
* @tracySkipLocation
377377
*/
378-
public static function addBreakpoint(?string $name = null, ?bool $enforceParent = null) {
378+
public static function addBreakpoint($name = null, $enforceParent = null) {
379379
if(self::tracyUnavailable() || !class_exists('\Zarganwar\PerformancePanel\Register')) return false;
380380
return Zarganwar\PerformancePanel\Register::add($name, $enforceParent);
381381
}

0 commit comments

Comments
 (0)