// Are we using Closures? If so, then we need
// to collect the params into an array
// so it can be passed to the controller method later.
if (!
is_string($handler) &&
is_callable($handler)) { $this->controller =
$handler;
// Remove the original string from the matches array
array_shift($matches);
$this->params =
$matches;
$this->
setMatchedRoute($matchedKey,
$handler);
return true;
} [$controller] =
explode('::',
$handler);
// Checks `/` in controller name
if (strpos($controller, '/'
) !== false
) { throw RouterException::
forInvalidControllerName($handler);
}