Completed
Pull Request — master (#2)
by Toni
12:51
created

Module::getAutoloaderConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
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
}