RolloutFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

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