Issues (105)

src/RouteCollections/Traits/RouteLoaderTrait.php (1 issue)

Labels
Severity
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
It seems like addCollection() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
            $this->/** @scrutinizer ignore-call */ 
23
                   addCollection($collection);
Loading history...
23
        }
24
    }
25
}
26