PageBreakpointServiceFactory::createService()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.7
c 0
b 0
f 0
cc 3
nc 4
nop 1
1
<?php
2
3
namespace Columnis\Service\Factory;
4
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
use Columnis\Service\PageBreakpointService;
8
9
class PageBreakpointServiceFactory implements FactoryInterface {
10
11
    /**
12
     * {@inheritDoc}
13
     *
14
     * @return PageBreakpointService
15
     */
16
    public function createService(ServiceLocatorInterface $serviceLocator) {
17
        $templatesPathStack = array();
18
        $AssetsManagerPaths = array();
19
20
        $gkSmarty = $serviceLocator->get('GkSmartyRenderer');
21
        $smarty = $gkSmarty->getEngine();
22
        $config = $serviceLocator->get('Config');
23
24
        if(isset($config['view_manager']['template_path_stack'])) {
25
            $templatesPathStack = $config['view_manager']['template_path_stack'];
26
        }
27
28
        if(isset($config['asset_manager']['resolver_configs']['paths'])) {
29
            $AssetsManagerPaths = $config['asset_manager']['resolver_configs']['paths'];
30
        }
31
        return new PageBreakpointService($smarty, $templatesPathStack, $AssetsManagerPaths);
32
    }
33
}
34