Skip to content

Commit

Permalink
refactored controller parser
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjgreen committed Aug 18, 2014
1 parent 8c9c495 commit 2ce7f5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Phroute/RouteCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ public function controller($route, $classname)
$reflection = new ReflectionClass($classname);

$validMethods = $this->getValidMethods();

$sep = $route === '/' ? '' : '/';

foreach($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method)
{
Expand All @@ -157,9 +159,7 @@ public function controller($route, $classname)
{
$this->addRoute($valid, $route . $params, array($classname, $method->name));
}

$sep = $route === '/' ? '' : '/';


$this->addRoute($valid, $route . $sep . $methodName . $params, array($classname, $method->name));

break;
Expand Down

0 comments on commit 2ce7f5e

Please sign in to comment.