ScriptHandlerFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 20
c 0
b 0
f 0
wmc 1
lcom 0
cbo 3
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Facile\ZFLinkHeadersModule\Listener;
6
7
use Facile\ZFLinkHeadersModule\OptionsInterface;
8
use Psr\Container\ContainerInterface;
9
use Zend\View\Helper\HeadScript;
10
use Zend\View\HelperPluginManager;
11
12
/**
13
 * Class ScriptHandlerFactory
14
 */
15
class ScriptHandlerFactory
16
{
17
    /**
18
     * @param ContainerInterface $container
19
     * @return ScriptHandler
20
     * @throws \Psr\Container\ContainerExceptionInterface
21
     * @throws \Psr\Container\NotFoundExceptionInterface
22
     */
23 1
    public function __invoke(ContainerInterface $container)
24
    {
25
        /** @var HelperPluginManager $plugins */
26 1
        $plugins = $container->get('ViewHelperManager');
27
        /** @var HeadScript $headScript */
28 1
        $headScript = $plugins->get(HeadScript::class);
29
30 1
        $options = $container->get(OptionsInterface::class);
31
32 1
        return new ScriptHandler($headScript, $options);
33
    }
34
}
35