VarTranslatorFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 11 1
1
<?php
2
/**
3
 * Webino (http://webino.sk)
4
 *
5
 * @link        https://github.com/webino/WebinoDraw for the canonical source repository
6
 * @copyright   Copyright (c) 2012-2017 Webino, s. r. o. (http://webino.sk)
7
 * @author      Peter Bačinský <[email protected]>
8
 * @license     BSD-3-Clause
9
 */
10
11
namespace WebinoDraw\Factory;
12
13
use WebinoDraw\VarTranslator\Operation\Filter;
14
use WebinoDraw\VarTranslator\Operation\Helper;
15
use WebinoDraw\VarTranslator\Operation\OnVar;
16
use WebinoDraw\VarTranslator\VarTranslator;
17
use Zend\ServiceManager\FactoryInterface;
18
use Zend\ServiceManager\ServiceLocatorInterface;
19
20
/**
21
 * Class VarTranslatorFactory
22
 */
23
class VarTranslatorFactory implements FactoryInterface
24
{
25
    /**
26
     * @param ServiceLocatorInterface $services
27
     * @return VarTranslator
28
     */
29
    public function createService(ServiceLocatorInterface $services)
30
    {
31
        /** @var \Zend\Filter\FilterPluginManager $filters */
32
        $filters = $services->get('FilterManager');
33
        /** @var \Zend\View\HelperPluginManager $helpers */
34
        $helpers = $services->get('ViewHelperManager');
35
        /** @var OnVar $onVar */
36
        $onVar = $services->get(OnVar::class);
37
38
        return new VarTranslator(new Filter($filters), new Helper($helpers), $onVar);
39
    }
40
}
41