EntityRepositoryManager::hasRepository()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\LaminasEntity\Service;
6
7
use Arp\DoctrineEntityRepository\EntityRepositoryInterface;
8
use Arp\DoctrineEntityRepository\EntityRepositoryProviderInterface;
9
use Laminas\ServiceManager\AbstractPluginManager;
10
11
/**
12
 * @author  Alex Patterson <[email protected]>
13
 * @package Arp\LaminasEntity\Service
14
 */
15
final class EntityRepositoryManager extends AbstractPluginManager implements EntityRepositoryProviderInterface
16
{
17
    /**
18
     * An object type that the created instance must be instanced of
19
     *
20
     * @var null|string
21
     */
22
    protected $instanceOf = EntityRepositoryInterface::class;
23
24
    /**
25
     * @param string $entityName
26
     *
27
     * @return bool
28
     */
29
    public function hasRepository(string $entityName): bool
30
    {
31
        return $this->has($entityName);
32
    }
33
34
    /**
35
     * @param string $entityName
36
     * @param array  $options
37
     *
38
     * @return EntityRepositoryInterface
39
     *
40
     * @throws \Throwable
41
     */
42
    public function getRepository(string $entityName, array $options = []): EntityRepositoryInterface
43
    {
44
        return $this->get($entityName, $options);
45
    }
46
}
47