1 | <?php |
||
2 | |||
3 | namespace Nip\Router\RouteCollections\Traits; |
||
4 | |||
5 | use Symfony\Component\Routing\RouteCollection; |
||
6 | |||
7 | /** |
||
8 | * Trait RouteLoaderTrait |
||
9 | * @package Nip\Router\RouteCollections\Traits |
||
10 | */ |
||
11 | trait RouteLoaderTrait |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * @param $path |
||
16 | */ |
||
17 | public function loadFromIncludedPhp($path) |
||
18 | { |
||
19 | /** @noinspection PhpIncludeInspection */ |
||
20 | $collection = require $path; |
||
21 | if ($collection instanceof RouteCollection) { |
||
22 | $this->addCollection($collection); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
23 | } |
||
24 | } |
||
25 | } |
||
26 |