Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | 2 | public function load(Environment $environment, object $plugin): void |
|
25 | { |
||
26 | 2 | if (!($plugin instanceof TwigTemplatePluginInterface)) { |
|
27 | 2 | return; |
|
28 | } |
||
29 | |||
30 | /** @var FilesystemLoader $loader */ |
||
31 | 2 | $loader = $environment->getLoader(); |
|
32 | 2 | if (!($loader instanceof FilesystemLoader)) { |
|
|
|||
33 | 1 | throw new \InvalidArgumentException(sprintf('The loader supports only %s', FilesystemLoader::class)); |
|
34 | } |
||
35 | |||
36 | 1 | $namespace = $plugin->getTwigNamespace(); |
|
37 | 1 | $paths = $plugin->getTwigTemplatePaths(); |
|
38 | |||
39 | 1 | $this->registerTemplates($loader, $paths, $namespace); |
|
40 | } |
||
58 |