Skip to content

Commit

Permalink
[ci skip] Routes collector for toolbar should not die when a method n…
Browse files Browse the repository at this point in the history
…ame is calculated through remap. Fixes #2277
  • Loading branch information
lonnieezell committed Oct 4, 2019
1 parent 93a2193 commit 3aa7eff
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion system/Debug/Toolbar/Collectors/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,25 @@ public function display(): array
$route = $router->getMatchedRoute();

// Get our parameters
$method = is_callable($router->controllerName()) ? new \ReflectionFunction($router->controllerName()) : new \ReflectionMethod($router->controllerName(), $router->methodName());
// Closure routes
if (is_callable($router->controllerName()))
{
$method = new \ReflectionFunction($router->controllerName());
}
else
{
try
{
$method = new \ReflectionMethod($router->controllerName(), $router->methodName());
}
catch (\ReflectionException $e)
{
// If we're here, the method doesn't exist
// and is likely calculated in _remap.
$method = new \ReflectionMethod($router->controllerName(), '_remap');
}
}

$rawParams = $method->getParameters();

$params = [];
Expand Down

0 comments on commit 3aa7eff

Please sign in to comment.