diff --git a/Route.php b/Route.php index 6e38263..ecf679f 100644 --- a/Route.php +++ b/Route.php @@ -103,8 +103,11 @@ abstract class Route ); } - static function group(string $prefix = '', callable $callback) + static function group(string $prefix = '', ?callable $callback = null) { + if ($callback === null) { + throw new InvalidArgumentException('Argument $callback must be of type callable.'); + } if (!str_starts_with( self::getRequestPath(), self::$prefix . $prefix