RolloutCollectorFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createService() 0 4 1
A __invoke() 0 11 1
1
<?php
2
/*
3
 * This file is part of the Adlogix package.
4
 *
5
 * (c) Allan Segebarth <[email protected]>
6
 * (c) Jean-Jacques Courtens <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Adlogix\Zf2Rollout\Service\Factory;
13
14
use Adlogix\Zf2Rollout\Collector\RolloutCollector;
15
use Interop\Container\ContainerInterface;
16
use Opensoft\Rollout\Rollout;
17
use Opensoft\Rollout\RolloutUserInterface;
18
use Zend\ServiceManager\FactoryInterface;
19
use Zend\ServiceManager\ServiceLocatorInterface;
20
21
/**
22
 * @author Toni Van de Voorde <[email protected]>
23
 */
24
final class RolloutCollectorFactory implements FactoryInterface
25
{
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function createService(ServiceLocatorInterface $serviceLocator)
31
    {
32
        return $this($serviceLocator, null);
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
39
    {
40
41
        /** @var Rollout $rollout */
42
        $rollout = $container->get('zf2_rollout');
43
44
        /** @var RolloutUserInterface $rolloutUser */
45
        $rolloutUser = $container->get('zf2_rollout_user');
46
47
        return new RolloutCollector($rollout, $rolloutUser);
48
    }
49
}
50