Total Complexity | 5 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class RoutingAnnotationLoader extends Loader |
||
11 | { |
||
12 | /** |
||
13 | * @var AnnotatedRouteControllerLoader |
||
14 | */ |
||
15 | private $annotatedRouteControllerLoader; |
||
16 | |||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | private $configuration; |
||
21 | |||
22 | public function load($resource, ?string $type = null): RouteCollection |
||
23 | { |
||
24 | $routeCollection = new RouteCollection(); |
||
25 | if (true === $this->configuration['enabled_viewer']) { |
||
26 | $routeCollection = $this->annotatedRouteControllerLoader->load(ViewerController::class); |
||
27 | } |
||
28 | |||
29 | return $routeCollection; |
||
30 | } |
||
31 | |||
32 | public function supports($resource, ?string $type = null): bool |
||
35 | } |
||
36 | |||
37 | public function setAnnotatedRouteControllerLoader(AnnotatedRouteControllerLoader $annotatedRouteController): void |
||
38 | { |
||
39 | $this->annotatedRouteControllerLoader = $annotatedRouteController; |
||
40 | } |
||
41 | |||
42 | public function setConfiguration(array $configuration): void |
||
45 | } |
||
46 | } |
||
47 |