1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-16 21:08:34 +01:00

php 8.1 deprecations (#494)

* php 8.1 deprecations

* php 8.1 deprecations

* Update DataFormatter.php
This commit is contained in:
Nicola Galgano 2021-12-27 19:49:48 +01:00 committed by GitHub
parent d7a9c22602
commit 0d44b75f3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -789,6 +789,8 @@ class JavascriptRenderer
return $uris;
}
$uri = $uri ?? '';
if (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri)) {
return $uri;
}
@ -805,7 +807,7 @@ class JavascriptRenderer
protected function filterAssetArray($array, $type = '')
{
$types = array('css', 'js', 'inline_css', 'inline_js', 'inline_head');
$typeIndex = array_search(strtolower($type), $types);
$typeIndex = array_search(strtolower($type ?? ''), $types);
return $typeIndex !== false ? $array[$typeIndex] : $array;
}