-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroup.php
More file actions
25 lines (21 loc) · 776 Bytes
/
Group.php
File metadata and controls
25 lines (21 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
declare(strict_types=1);
namespace Stasis\Router\Route;
readonly class Group implements RouteInterface
{
/**
* A collection of routes that share a common root path.
*
* @param string $path Root path of the group, starting with slash. All routes in the group will be prefixed with this path.
* @param iterable<RouteInterface>|RouteProviderInterface|string $routes List of routes, route provider instance, or service reference implementing RouteProviderInterface.
*/
public function __construct(
public string $path,
public iterable|RouteProviderInterface|string $routes = [],
) {}
#[\Override]
public function accept(RouteVisitorInterface $visitor): void
{
$visitor->visitGroup($this);
}
}