Skip to content

Commit d04b3dc

Browse files
committed
compat with zend diactoros
1 parent fa6002b commit d04b3dc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/PhpDebugBarMiddleware.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,15 @@ private function getStaticFile(UriInterface $uri)
8383
return;
8484
}
8585

86-
if (empty($uri->getBasePath())) {
87-
return;
86+
if (method_exists($uri, 'getBasePath')) {
87+
if (empty($uri->getBasePath())) {
88+
return;
89+
}
90+
$path = $uri->getBasePath() ?: $uri->getPath();
91+
} else {
92+
$path = $uri->getPath();
8893
}
8994

90-
$path = $uri->getBasePath() ?: $uri->getPath();
9195
$pathToFile = substr($path, strlen($this->debugBarRenderer->getBaseUrl()));
9296

9397
$fullPathToFile = $this->debugBarRenderer->getBasePath() . $pathToFile;

0 commit comments

Comments
 (0)