public function respondsTo($method = null)
{
if (null === $method) {
return array_keys($this->methods);
}
$method = strtoupper($method);
return isset($this->methods[$method]);
}
/** * Determine what methods a route responds to * * @param Route $route * @param int $index */ protected function registerRouteMethods(Route $route, $index) { foreach ($route->respondsTo() as $method) { if (!isset($this->routesByMethod[$method])) { $this->routesByMethod[$method] = []; } $this->routesByMethod[$method][$index] = $route; } }