Skip to content

Commit

Permalink
Change pathMatchesPattern to requestMatchesPattern
Browse files Browse the repository at this point in the history
  • Loading branch information
igorw committed Nov 4, 2012
1 parent 8ac0cc6 commit 6069b6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/React/Gifsocket/Router.php
Expand Up @@ -14,7 +14,7 @@ public function __construct(array $routes)
public function __invoke($request, $response)
{
foreach ($this->routes as $pattern => $controller) {
if ($this->pathMatchesPattern($request->getPath(), $pattern, $controller)) {
if ($this->requestMatchesPattern($request, $pattern)) {
$controller($request, $response);
return;
}
Expand All @@ -23,9 +23,9 @@ public function __invoke($request, $response)
$this->handleNotFound($request, $response);
}

protected function pathMatchesPattern($requestPath, $pattern, $controller)
protected function requestMatchesPattern($request, $pattern)
{
return $pattern === $requestPath;
return $pattern === $request->getPath();
}

protected function handleNotFound($request, $response)
Expand Down

0 comments on commit 6069b6a

Please sign in to comment.