Skip to content

Commit 12a1eef

Browse files
authored
Dont use null where string is expected (php-debugbar#489)
Quickfix for PHP 8.1 compatibility
1 parent 14bdc78 commit 12a1eef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/DebugBar/JavascriptRenderer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,8 @@ public function getAssets($type = null, $relativeTo = self::RELATIVE_PATH)
719719
}
720720

721721
foreach ($additionalAssets as $assets) {
722-
$basePath = isset($assets['base_path']) ? $assets['base_path'] : null;
723-
$baseUrl = isset($assets['base_url']) ? $assets['base_url'] : null;
722+
$basePath = isset($assets['base_path']) ? $assets['base_path'] : '';
723+
$baseUrl = isset($assets['base_url']) ? $assets['base_url'] : '';
724724
$root = $this->getRelativeRoot($relativeTo,
725725
$this->makeUriRelativeTo($basePath, $this->basePath),
726726
$this->makeUriRelativeTo($baseUrl, $this->baseUrl));
@@ -746,7 +746,7 @@ public function getAssets($type = null, $relativeTo = self::RELATIVE_PATH)
746746
$cssFiles = array_unique($cssFiles);
747747
$jsFiles = array_unique($jsFiles);
748748

749-
return $this->filterAssetArray(array($cssFiles, $jsFiles, $inlineCss, $inlineJs, $inlineHead), $type);
749+
return $this->filterAssetArray(array($cssFiles, $jsFiles, $inlineCss, $inlineJs, $inlineHead), $type ?? '');
750750
}
751751

752752
/**
@@ -802,7 +802,7 @@ protected function makeUriRelativeTo($uri, $root)
802802
* @param string $type 'css', 'js', 'inline_css', 'inline_js', 'inline_head', or null for all
803803
* @return array
804804
*/
805-
protected function filterAssetArray($array, $type = null)
805+
protected function filterAssetArray($array, $type = '')
806806
{
807807
$types = array('css', 'js', 'inline_css', 'inline_js', 'inline_head');
808808
$typeIndex = array_search(strtolower($type), $types);

0 commit comments

Comments
 (0)