diff --git a/src/Routing/RouteCollection.php b/src/Routing/RouteCollection.php index 91fe9442da4..d55c43c2bfa 100644 --- a/src/Routing/RouteCollection.php +++ b/src/Routing/RouteCollection.php @@ -272,14 +272,16 @@ protected function _getNames($url) } /** - * Reverse route or match a $url array with the defined routes. - * Returns either the string URL generate by the route, or false on failure. + * Reverse route or match a $url array with the connected routes. * - * @param array $url The url to match. + * Returns either the URL string generated by the route, + * or throws an exception on failure. + * + * @param array $url The URL to match. * @param array $context The request context to use. Contains _base, _port, * _host, _scheme and params keys. - * @return string|false Either a string on match, or false on failure. - * @throws \Cake\Routing\Exception\MissingRouteException when a route cannot be matched. + * @return string The URL string on match. + * @throws \Cake\Routing\Exception\MissingRouteException When no route could be matched. */ public function match($url, $context) { @@ -287,7 +289,6 @@ public function match($url, $context) if (isset($url['_name'])) { $name = $url['_name']; unset($url['_name']); - $out = false; if (isset($this->_named[$name])) { $route = $this->_named[$name]; $out = $route->match($url + $route->defaults, $context);