PageBreakpointServiceFactory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 17 3
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