Passed
Pull Request — master (#2)
by Alex
08:14
created

EntityManagerContainerFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 3
c 0
b 0
f 0
dl 0
loc 20
rs 10

1 Method

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

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

38
        return /** @scrutinizer ignore-deprecated */ new EntityManagerContainer($container, $config);
Loading history...
39
    }
40
}
41