Skip to content

Commit 23654c5

Browse files
committed
upated readme
1 parent 8bebe7a commit 23654c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Router.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public function toRoute(string $name, array $params = null) {
444444
throw new Exception('The route parameters are missing.', 404);
445445
}
446446
} elseif ($route === '*') {
447-
throw new Exception('The name root cannot be used when you use the asterisk (*) symbol in the root.', 404);
447+
throw new Exception('The name route cannot be used when you use the asterisk (*) symbol in the route.', 404);
448448
} else {
449449
$url .= '/' . $route;
450450

@@ -487,13 +487,13 @@ public function fallbackHandling(): mixed {
487487
* Helper function of name.
488488
*/
489489
public function helperFunctionOfName(string $name, string $method): void {
490-
// Check if root name is used once, Throw exception if name is used.
490+
// Check if route name is used once, Throw exception if name is used.
491491
if (!empty($this->routeNames[$method])) {
492492
if (in_array($name, $this->routeNames[$method])) {
493493
throw new Exception('Router name (' . $name . ') has been used more than once');
494494
}
495495
}
496-
// Set name to root
496+
// Set name to route
497497
$this->routes[$method][array_key_last($this->routes[$method])]['name'] = $name;
498498

499499
$this->routeNames[$method][] = $name;
@@ -503,7 +503,7 @@ public function helperFunctionOfName(string $name, string $method): void {
503503
* Helper function of middleware.
504504
*/
505505
public function helperFunctionOfMiddleware(string | array $middleware, string $method): void {
506-
// Set middleware to root
506+
// Set middleware to route
507507
if (is_array($middleware)) {
508508
if (is_array($this->routes[$method][array_key_last($this->routes[$method])]['middleware'])) {
509509
$array_merge = array_merge($this->routes[$method][array_key_last($this->routes[$method])]['middleware'], $middleware);

0 commit comments

Comments
 (0)