HtmlCacheFactory::createService()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Columnis\Service\Factory;
4
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
use Columnis\Model\HtmlCache;
8
 
9
class HtmlCacheFactory implements FactoryInterface
10
{
11
    /**
12
     * {@inheritDoc}
13
     *
14
     * @return HtmlCache
15
     */
16
    public function createService(ServiceLocatorInterface $serviceLocator)
17
    {
18
        // Configure the cache
19
        $config = $serviceLocator->get('Config');
20
        $cacheConfig = isset($config['cache']) ? $config['cache'] : array();
21
        $cache = StorageFactory::factory($cacheConfig);
22
        
23
        return new HtmlCache($cache);
24
    }
25
}
26