Skip to content

Commit 0d44b75

Browse files
authored
php 8.1 deprecations (php-debugbar#494)
* php 8.1 deprecations * php 8.1 deprecations * Update DataFormatter.php
1 parent d7a9c22 commit 0d44b75

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/DebugBar/JavascriptRenderer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,8 @@ protected function makeUriRelativeTo($uri, $root)
789789
return $uris;
790790
}
791791

792+
$uri = $uri ?? '';
793+
792794
if (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri)) {
793795
return $uri;
794796
}
@@ -805,7 +807,7 @@ protected function makeUriRelativeTo($uri, $root)
805807
protected function filterAssetArray($array, $type = '')
806808
{
807809
$types = array('css', 'js', 'inline_css', 'inline_js', 'inline_head');
808-
$typeIndex = array_search(strtolower($type), $types);
810+
$typeIndex = array_search(strtolower($type ?? ''), $types);
809811
return $typeIndex !== false ? $array[$typeIndex] : $array;
810812
}
811813

0 commit comments

Comments
 (0)