Completed
Push — master ( baff27...3a9c47 )
by Daniel
02:56
created

ConfigLoaderHelperFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 23
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
1
<?php
2
/**
3
 * This file is part of the Commander project.
4
 *
5
 * @author Daniel Schröder <[email protected]>
6
 */
7
8
namespace GravityMedia\Commander\Console\Helper;
9
10
use GravityMedia\Commander\Config\Loader;
11
use Interop\Container\ContainerInterface;
12
use Interop\Container\Exception\ContainerException;
13
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
14
use Zend\ServiceManager\Exception\ServiceNotFoundException;
15
use Zend\ServiceManager\Factory\FactoryInterface;
16
17
/**
18
 * Config loader helper factory class.
19
 *
20
 * @package GravityMedia\Commander\Serializer
21
 */
22
class ConfigLoaderHelperFactory implements FactoryInterface
23
{
24
    /**
25
     * Create config loader helper object.
26
     *
27
     * @param  ContainerInterface $container
28
     * @param  string             $requestedName
29
     * @param  null|array         $options
30
     *
31
     * @return ConfigLoaderHelper
32
     *
33
     * @throws ServiceNotFoundException if unable to resolve the service.
34
     * @throws ServiceNotCreatedException if an exception is raised when creating a service.
35
     * @throws ContainerException if any other error occurs.
36
     */
37 2
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
38
    {
39
        /** @var Loader $commanderConfigLoader */
40 2
        $commanderConfigLoader = $container->get(Loader::class);
41
42 2
        return new ConfigLoaderHelper($commanderConfigLoader);
43
    }
44
}
45