| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function load($resource, string $type = null) |
||
| 21 | { |
||
| 22 | if (true === $this->isLoaded) { |
||
| 23 | throw new \RuntimeException('Do not add the "extra" loader twice'); |
||
| 24 | } |
||
| 25 | |||
| 26 | $routes = new RouteCollection(); |
||
| 27 | |||
| 28 | foreach ($this->routeAutoloader->getObblmRoutes() as $route) { |
||
| 29 | $importedRoutes = $this->import($route['resource'], $route['type']); |
||
| 30 | $routes->addCollection($importedRoutes); |
||
| 31 | } |
||
| 32 | |||
| 33 | $this->isLoaded = true; |
||
| 34 | |||
| 35 | return $routes; |
||
| 36 | } |
||
| 43 |