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

PersistServiceManagerFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
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 22
rs 10

1 Method

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