Skip to content

Commit

Permalink
Correct and improve doc block of RouteCollection::match()
Browse files Browse the repository at this point in the history
Plus remove unused variable.
  • Loading branch information
ravage84 committed Apr 24, 2017
1 parent 04e2fbb commit 7ba96dc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Routing/RouteCollection.php
Expand Up @@ -272,22 +272,23 @@ 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)
{
// Named routes support optimization.
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);
Expand Down

0 comments on commit 7ba96dc

Please sign in to comment.