DataTransformerFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 16 1
1
<?php
2
/**
3
 * YAWIK Stackoverflow API
4
 *
5
 * @filesource
6
 * @license MIT
7
 * @copyright  2016 - 2017 Cross Solution <http://cross-solution.de>
8
 */
9
  
10
/** */
11
namespace StackoverflowApi\Factory\Client;
12
13
use Interop\Container\ContainerInterface;
14
use StackoverflowApi\Client\DataTransformer;
15
use Zend\ServiceManager\Factory\FactoryInterface;
16
17
/**
18
 * Factory for \StackoverflowApi\Client\DataTransformer
19
 * 
20
 * @author Mathias Gelhausen <[email protected]>
21
 * @since 0.1.0
22
 */
23
class DataTransformerFactory implements FactoryInterface
24
{
25
    /**
26
     * Create a DataTransformer
27
     *
28
     * @param ContainerInterface $container
29
     * @param string             $requestedName
30
     * @param array              $options
31
     *
32
     * @return DataTransformer
33
     */
34 1
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
35
    {
36 1
        $viewHelperManager = $container->get('ViewHelperManager');
37 1
        $applyUrlHelper    = $viewHelperManager->get('applyUrl');
38 1
        $serverUrlHelper   = $viewHelperManager->get('serverUrl');
39 1
        $orgImageManager   = $container->get('Organizations\ImageFileCache\Manager');
40 1
        $transformer       = new DataTransformer();
41
42
        $transformer
43 1
            ->setApplyUrlHelper($applyUrlHelper)
44 1
            ->setServerUrlHelper($serverUrlHelper)
45 1
            ->setOrganizationImageManager($orgImageManager)
46
        ;
47
48 1
        return $transformer;
49
    }
50
}
51