/** * Adds a route to the collection that handles the given request * methods. * * @param string $methods methods seperated by a pipe |. * @param string $pattern * @param string $handler * @param array $requirements * @param array $defaults * * @return void */ public function addRoute($methods, $pattern, $handler, array $requirements = [], array $defaults = []) { list($name, $host, $schemes, $constraints) = $this->parseRequirements($this->extendRequirements($requirements), $methods); $route = new Route($this->prefixPattern($pattern), $handler, is_array($methods) ? $methods : explode('|', $methods), $host, $defaults, $constraints, is_array($schemes) ? $schemes : explode('|', $schemes)); $this->routes->add($name, $route); }