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

PersistServiceManagerFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 3
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