Skip to content

Commit

Permalink
RoutingPanel: fixed compatibility with new RouteList II. [Closes #251][
Browse files Browse the repository at this point in the history
…Closes #253]

Does not test inner routers when unless main RouteList matches (for example due domain etc.)
  • Loading branch information
dg committed Apr 2, 2020
1 parent 717bb5c commit a59449e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Bridges/ApplicationTracy/RoutingPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,20 @@ public function getPanel(): string
/**
* Analyses simple route.
*/
private function analyse(Routing\Router $router, string $module = ''): void
private function analyse(Routing\Router $router, string $module = '', bool $parentMatches = true): void
{
if ($router instanceof Routing\RouteList) {
if ($router->match($this->httpRequest)) {
foreach ($router->getRouters() as $subRouter) {
$this->analyse($subRouter, $module . $router->getModule());
}
$parentMatches = $parentMatches && $router->match($this->httpRequest) !== null;
foreach ($router->getRouters() as $subRouter) {
$this->analyse($subRouter, $module . $router->getModule(), $parentMatches);
}
return;
}

$matched = 'no';
$params = $e = null;
try {
$params = $router->match($this->httpRequest);
$params = $parentMatches ? $router->match($this->httpRequest) : null;
} catch (\Exception $e) {
}
if ($params !== null) {
Expand Down

0 comments on commit a59449e

Please sign in to comment.