Skip to content

Commit

Permalink
Make RouteCollector members protected
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jan 19, 2017
1 parent e9d8e97 commit b5f9574
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
16 changes: 3 additions & 13 deletions src/RouteCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace FastRoute;

class RouteCollector {
private $routeParser;
private $dataGenerator;
private $currentGroupPrefix;
protected $routeParser;
protected $dataGenerator;
protected $currentGroupPrefix;

/**
* Constructs a route collector.
Expand Down Expand Up @@ -38,16 +38,6 @@ public function addRoute($httpMethod, $route, $handler) {
}
}

/**
* Prepend the group prefix to a route
*
* @param string $route
* @return string
*/
protected function prependGroupPrefix($route) {
return $this->currentGroupPrefix . $route;
}

/**
* Create a route group with a common prefix.
*
Expand Down
2 changes: 1 addition & 1 deletion test/RouteCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class DummyRouteCollector extends RouteCollector {
public $routes = [];
public function __construct() {}
public function addRoute($method, $route, $handler) {
$route = $this->prependGroupPrefix($route);
$route = $this->currentGroupPrefix . $route;
$this->routes[] = [$method, $route, $handler];
}
}

0 comments on commit b5f9574

Please sign in to comment.