Completed
Push — master ( b0e594...3a79fc )
by Alejandro
03:21 queued 01:12
created

ConfigMigrationControllerFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 24
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 9 1
1
<?php
2
namespace AcMailer\Controller\Factory;
3
4
use AcMailer\Controller\ConfigMigrationController;
5
use AcMailer\Service\ConfigMigrationService;
6
use AcMailer\Service\ConfigMigrationServiceInterface;
7
use Interop\Container\ContainerInterface;
8
use Interop\Container\Exception\ContainerException;
9
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
10
use Zend\ServiceManager\Exception\ServiceNotFoundException;
11
use Zend\ServiceManager\Factory\FactoryInterface;
12
use Zend\ServiceManager\ServiceLocatorInterface;
13
14
/**
15
 * Class ConfigMigrationControllerFactory
16
 * @author Alejandro Celaya Alastrué
17
 * @link http://www.alejandrocelaya.com
18
 */
19
class ConfigMigrationControllerFactory implements FactoryInterface
20
{
21
    /**
22
     * Create an object
23
     *
24
     * @param  ContainerInterface $container
25
     * @param  string $requestedName
26
     * @param  null|array $options
27
     * @return object
28
     * @throws ServiceNotFoundException if unable to resolve the service.
29
     * @throws ServiceNotCreatedException if an exception is raised when
30
     *     creating a service.
31
     * @throws ContainerException if any other error occurs
32
     */
33 1
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
34
    {
35
        /** @var array $config */
36 1
        $config = $container->get('config');
37
        /** @var ConfigMigrationServiceInterface $configMigrationService */
38 1
        $configMigrationService = $container->get(ConfigMigrationService::class);
39
40 1
        return new ConfigMigrationController($configMigrationService, $config);
41
    }
42
}
43