PathStackResolverServiceFactory::__invoke()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 2
nop 1
1
<?php
2
3
namespace AssetManager\Core\Service;
4
5
use AssetManager\Core\Resolver\PathStackResolver;
6
use Psr\Container\ContainerInterface;
7
8
class PathStackResolverServiceFactory
9
{
10
    /**
11
     * @inheritDoc
12
     */
13
    public function __invoke(ContainerInterface $container)
14
    {
15
        $config            = $container->get('config');
16
        $pathStackResolver = new PathStackResolver();
17
        $paths             = array();
18
19
        if (isset($config['asset_manager']['resolver_configs']['paths'])) {
20
            $paths = $config['asset_manager']['resolver_configs']['paths'];
21
        }
22
23
        $pathStackResolver->addPaths($paths);
24
25
        return $pathStackResolver;
26
    }
27
}
28