Completed
Pull Request — master (#98)
by Alejandro
06:29
created

DefaultConfigCustomizerPluginFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 4 1
1
<?php
2
namespace Shlinkio\Shlink\CLI\Install\Plugin\Factory;
3
4
use Interop\Container\ContainerInterface;
5
use Interop\Container\Exception\ContainerException;
6
use Symfony\Component\Console\Helper\QuestionHelper;
7
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
8
use Zend\ServiceManager\Exception\ServiceNotFoundException;
9
use Zend\ServiceManager\Factory\FactoryInterface;
10
11
class DefaultConfigCustomizerPluginFactory implements FactoryInterface
12
{
13
    /**
14
     * Create an object
15
     *
16
     * @param  ContainerInterface $container
17
     * @param  string $requestedName
18
     * @param  null|array $options
19
     * @return object
20
     * @throws ServiceNotFoundException if unable to resolve the service.
21
     * @throws ServiceNotCreatedException if an exception is raised when
22
     *     creating a service.
23
     * @throws ContainerException if any other error occurs
24
     */
25 1
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
26
    {
27 1
        return new $requestedName($container->get(QuestionHelper::class));
28
    }
29
}
30