Test Failed
Push — main ( c7561b...fa446d )
by Bingo
15:52
created

DbEntityManagerFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Jabe\Engine\Impl\Db\EntityManager;
4
5
use Jabe\Engine\Impl\Cfg\IdGeneratorInterface;
6
use Jabe\Engine\Impl\Context\Context;
7
use Jabe\Engine\Impl\Db\PersistenceSessionInterface;
8
use Jabe\Engine\Impl\Interceptor\SessionFactoryInterface;
9
10
class DbEntityManagerFactory implements SessionFactoryInterface
11
{
12
    protected $idGenerator;
13
14
    public function __construct(IdGeneratorInterface $idGenerator)
15
    {
16
        $this->idGenerator = $idGenerator;
17
    }
18
19
    public function getSessionType(): string
20
    {
21
        return DbEntityManager::class;
22
    }
23
24
    public function openSession(): DbEntityManager
25
    {
26
        $persistenceSession = Context::getCommandContext()->getSession(PersistenceSessionInterface::class);
27
        return new DbEntityManager($idGenerator, $persistenceSession);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $idGenerator seems to be never defined.
Loading history...
28
    }
29
}
30