Skip to content

Commit b5f9574

Browse files
committed
Make RouteCollector members protected
1 parent e9d8e97 commit b5f9574

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

src/RouteCollector.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace FastRoute;
44

55
class RouteCollector {
6-
private $routeParser;
7-
private $dataGenerator;
8-
private $currentGroupPrefix;
6+
protected $routeParser;
7+
protected $dataGenerator;
8+
protected $currentGroupPrefix;
99

1010
/**
1111
* Constructs a route collector.
@@ -38,16 +38,6 @@ public function addRoute($httpMethod, $route, $handler) {
3838
}
3939
}
4040

41-
/**
42-
* Prepend the group prefix to a route
43-
*
44-
* @param string $route
45-
* @return string
46-
*/
47-
protected function prependGroupPrefix($route) {
48-
return $this->currentGroupPrefix . $route;
49-
}
50-
5141
/**
5242
* Create a route group with a common prefix.
5343
*

test/RouteCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class DummyRouteCollector extends RouteCollector {
9191
public $routes = [];
9292
public function __construct() {}
9393
public function addRoute($method, $route, $handler) {
94-
$route = $this->prependGroupPrefix($route);
94+
$route = $this->currentGroupPrefix . $route;
9595
$this->routes[] = [$method, $route, $handler];
9696
}
9797
}

0 commit comments

Comments
 (0)