1 | <?php declare(strict_types=1); |
||
8 | class RouteGroup implements |
||
9 | MiddlewareAwareInterface, |
||
10 | RouteCollectionInterface, |
||
11 | RouteConditionHandlerInterface, |
||
12 | StrategyAwareInterface |
||
13 | { |
||
14 | use MiddlewareAwareTrait; |
||
15 | use RouteCollectionTrait; |
||
16 | use RouteConditionHandlerTrait; |
||
17 | use StrategyAwareTrait; |
||
18 | |||
19 | /** |
||
20 | * @var callable |
||
21 | */ |
||
22 | protected $callback; |
||
23 | |||
24 | /** |
||
25 | * @var \League\Route\RouteCollectionInterface |
||
26 | */ |
||
27 | protected $collection; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $prefix; |
||
33 | |||
34 | /** |
||
35 | * Constructor. |
||
36 | * |
||
37 | * @param string $prefix |
||
38 | * @param callable $callback |
||
39 | * @param \League\Route\RouteCollection $collection |
||
40 | */ |
||
41 | 9 | public function __construct(string $prefix, callable $callback, RouteCollectionInterface $collection) |
|
47 | |||
48 | /** |
||
49 | * Return the prefix of the group. |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | public function getPrefix() : string |
||
57 | |||
58 | /** |
||
59 | * Process the group and ensure routes are added to the collection. |
||
60 | * |
||
61 | * @return void |
||
62 | */ |
||
63 | 6 | public function __invoke() : void |
|
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | 6 | public function map(string $method, string $path, $handler) : Route |
|
100 | } |
||
101 |