Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | protected function createLoader() |
||
27 | { |
||
28 | $app = $this->getContainer()->get('app'); |
||
29 | |||
30 | $locator = new FileLocator([ |
||
31 | $app->basePath() . DIRECTORY_SEPARATOR . 'routes', |
||
32 | $app->path(), |
||
33 | $app->basePath(), |
||
34 | ]); |
||
35 | |||
36 | $resolver = new \Symfony\Component\Config\Loader\LoaderResolver(); |
||
37 | $resolver->addLoader(new PhpFileLoader($locator)); |
||
38 | $resolver->addLoader(new DirectoryLoader($locator)); |
||
39 | |||
40 | $loader = new \Nip\Router\Loader\DelegatingLoader($resolver); |
||
41 | |||
42 | return $loader; |
||
43 | } |
||
44 | } |
||
45 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.