Passed
Push — master ( 79bf3c...52a24b )
by Alex
01:04 queued 13s
created

HelperManagerFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
c 1
b 0
f 0
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\LaminasDoctrine\Factory\Console\Module;
6
7
use Arp\LaminasFactory\AbstractFactory;
8
use Arp\LaminasDoctrine\Console\Module\HelperManager;
9
use Laminas\ServiceManager\Exception\InvalidArgumentException;
10
use Laminas\ServiceManager\Exception\ServiceNotCreatedException;
11
use Laminas\ServiceManager\Exception\ServiceNotFoundException;
12
use Psr\Container\ContainerInterface;
13
14
/**
15
 * @author  Alex Patterson <[email protected]>
16
 * @package Arp\LaminasDoctrine\Factory\Console\Module
17
 */
18
final class HelperManagerFactory extends AbstractFactory
19
{
20
    /**
21
     * @param ContainerInterface $container
22
     * @param string             $requestedName
23
     * @param array<mixed>|null  $options
24
     *
25
     * @return HelperManager
26
     *
27
     * @throws InvalidArgumentException
28
     * @throws ServiceNotCreatedException
29
     * @throws ServiceNotFoundException
30
     */
31
    public function __invoke(ContainerInterface $container, string $requestedName, array $options = null): HelperManager
32
    {
33
        $config = $options ?? $this->getApplicationOptions($container, 'arp_console_helper_manager');
34
35
        return new HelperManager($container, $config);
36
    }
37
}
38