TemplateServiceFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 12 2
1
<?php
2
3
namespace Columnis\Service\Factory;
4
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
use Columnis\Service\TemplateService;
8
9
class TemplateServiceFactory implements FactoryInterface
10
{
11
    /**
12
     * {@inheritDoc}
13
     *
14
     * @return TemplateService
15
     */
16 15
    public function createService(ServiceLocatorInterface $serviceLocator)
17
    {
18 15
        $templatesPathStack = array();
19
        
20 15
        $config      = $serviceLocator->get('Config');
21
        
22 15
        if (isset($config['view_manager']['template_path_stack'])) {
23 15
            $templatesPathStack = $config['view_manager']['template_path_stack'];
24 15
        }
25
        
26 15
        return new TemplateService($templatesPathStack);
27
    }
28
}
29