Completed
Push — master ( 38df09...7a08de )
by Daniel
08:33
created

CommanderConfigLoaderFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

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 0
cts 3
cp 0
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\Config\Loader;
9
10
use GravityMedia\Commander\Serializer\ConfigSerializer;
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
 * Commander config loader factory class
19
 *
20
 * @package GravityMedia\Commander\Loader
21
 */
22
class CommanderConfigLoaderFactory implements FactoryInterface
23
{
24
    /**
25
     * Create commander config loader object
26
     *
27
     * @param  ContainerInterface $container
28
     * @param  string             $requestedName
29
     * @param  null|array         $options
30
     *
31
     * @return CommanderConfigLoader
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
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
38
    {
39
        /** @var ConfigSerializer $configSerializer */
40
        $configSerializer = $container->get(ConfigSerializer::class);
41
42
        return new CommanderConfigLoader($configSerializer);
43
    }
44
}
45