AssetCacheManagerServiceFactory::__invoke()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
3
namespace AssetManager\Core\Service;
4
5
use Psr\Container\ContainerInterface;
6
7
/**
8
 * Factory for the Asset Cache Manager Service
9
 */
10
class AssetCacheManagerServiceFactory
11
{
12
    /**
13
     * @inheritDoc
14
     */
15
    public function __invoke(ContainerInterface $container)
16
    {
17
        $config = array();
18
19
        $globalConfig = $container->get('config');
20
21
        if (!empty($globalConfig['asset_manager']['caching'])) {
22
            $config = $globalConfig['asset_manager']['caching'];
23
        }
24
25
        return new AssetCacheManager($container, $config);
26
    }
27
}
28