From 7ba96dc2f152ab5583c979f6d4bfa5e18793f2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Mon, 24 Apr 2017 18:51:12 +0200 Subject: [PATCH] Correct and improve doc block of RouteCollection::match() Plus remove unused variable. --- src/Routing/RouteCollection.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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);