Completed
Push — master ( 408932...ce7eb5 )
by Dawid
06:58
created

GenericRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 26
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php declare(strict_types=1);
2
3
namespace Igni\Storage\Driver;
4
5
use Igni\Storage\EntityManager;
6
use Igni\Storage\Hydration\ObjectHydrator;
7
use Igni\Storage\Mapping\MetaData\EntityMetaData;
8
use Igni\Storage\Repository as RepositoryInterface;
9
10
abstract class GenericRepository implements RepositoryInterface
11
{
12
    /**
13
     * @var Connection
14
     */
15
    protected $connection;
16
    /**
17
     * @var EntityManager
18
     */
19
    protected $entityManager;
20
    /**
21
     * @var ObjectHydrator
22
     */
23
    protected $hydrator;
24
25
    /**
26
     * @var EntityMetaData
27
     */
28
    protected $metaData;
29
30 22
    final public function __construct(EntityManager $entityManager)
31
    {
32 22
        $this->entityManager = $entityManager;
33 22
        $this->metaData = $this->entityManager->getMetaData($this->getEntityClass());
34 22
        $this->hydrator = $this->entityManager->getHydrator($this->getEntityClass());
35 22
        $this->connection = ConnectionManager::getConnection($this->metaData->getConnection());
36 22
    }
37
}
38