mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Fixed typo
This commit is contained in:
@@ -59,7 +59,7 @@ interface IGroupRoute extends IRoute
|
||||
* @param string $url
|
||||
* @return static
|
||||
*/
|
||||
public function prependUrl(string $url): self;
|
||||
public function prependPrefix(string $url): self;
|
||||
|
||||
/**
|
||||
* Set prefix that child-routes will inherit.
|
||||
|
||||
@@ -159,7 +159,7 @@ class RouteGroup extends Route implements IGroupRoute
|
||||
* @param string $url
|
||||
* @return static
|
||||
*/
|
||||
public function prependUrl(string $url): IGroupRoute
|
||||
public function prependPrefix(string $url): IGroupRoute
|
||||
{
|
||||
return $this->setPrefix(rtrim($url, '/') . $this->prefix);
|
||||
}
|
||||
|
||||
@@ -110,9 +110,6 @@ class EventHandlerTest extends \PHPUnit\Framework\TestCase
|
||||
$eventHandler = new EventHandler();
|
||||
$eventHandler->register(EventHandler::EVENT_ADD_ROUTE, function(EventArgument $data) use($basePath) {
|
||||
|
||||
// Add basepath
|
||||
$basePath = rtrim($basePath, '/');
|
||||
|
||||
// Skip routes added by group
|
||||
if($data->isSubRoute === false) {
|
||||
|
||||
@@ -121,7 +118,7 @@ class EventHandlerTest extends \PHPUnit\Framework\TestCase
|
||||
$data->route->prependUrl($basePath);
|
||||
break;
|
||||
case $data->route instanceof \Pecee\SimpleRouter\Route\IGroupRoute:
|
||||
$data->route->setPrefix($basePath . $data->route->getPrefix());
|
||||
$data->route->prependPrefix($basePath);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user