Fixed typo

This commit is contained in:
Simon Sessingø
2021-03-31 03:25:35 +02:00
parent eccda10169
commit 8b11377fe8
3 changed files with 3 additions and 6 deletions
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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;
}