Completed
Push — master ( 415cd3...c4b326 )
by Toni
02:10
created

Module   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfig() 0 4 1
A getViewHelperConfig() 0 13 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;
13
14
15
use Opensoft\Rollout\Rollout;
16
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
17
use Zend\ModuleManager\Feature\ConfigProviderInterface;
18
use Zend\ModuleManager\Feature\ViewHelperProviderInterface;
19
use Zend\ServiceManager\AbstractPluginManager;
20
21
class Module implements ConfigProviderInterface, ViewHelperProviderInterface
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function getConfig()
27
    {
28
        return include __DIR__ . '/config/module.config.php';
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function getViewHelperConfig()
35
    {
36
        return [
37
            'factories' => [
38
                'rollout_is_active' => function (AbstractPluginManager $pluginManager) {
39
                    $serviceLocator = $pluginManager->getServiceLocator();
40
                    /** @var Rollout $rollout */
41
                    $rollout = $serviceLocator->get('zf2_rollout');
42
                    return new View\Helper\IsActive($rollout);
43
                }
44
            ],
45
        ];
46
    }
47
}