Skip to content

Commit

Permalink
Running xhgui from subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
luzip665 committed Jan 17, 2022
1 parent 276a255 commit cfc6022
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ public function __construct(Router $router, Request $request, ?string $pathPrefi
{
$this->router = $router;
$this->request = $request;
if (!$pathPrefix) {
$pathPrefix = '';

This comment has been minimized.

Copy link
@glensc

glensc Jan 17, 2022

Contributor

you didn't revert the attribute typing change, null allowed again

}
$this->pathPrefix = $pathPrefix;
}

Expand Down Expand Up @@ -81,7 +78,9 @@ public function url(string $name, $queryargs = []): string
// this is copy of \Slim\Slim::urlFor()
// to mix path prefix in \Slim\Slim::urlFor

return rtrim($this->pathPrefix, '/') . $this->router->urlFor($name) . $query;
$prepend = $this->pathPrefix ?: '';

This comment has been minimized.

Copy link
@glensc

glensc Jan 17, 2022

Contributor

would be just fine inlining this, and diff be smaller.


return rtrim($prepend, '/') . $this->router->urlFor($name) . $query;
}

/**
Expand Down Expand Up @@ -135,7 +134,7 @@ public function formatPercent($value): string

private function pathPrefix(): string
{
if ($this->pathPrefix !== '') {
if ($this->pathPrefix !== null) {
return $this->pathPrefix;
}

Expand Down

0 comments on commit cfc6022

Please sign in to comment.