SessionRepository   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 17
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A save() 0 4 1
A prototype() 0 3 1
A delete() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Uxmp\Core\Orm\Repository;
6
7
use Doctrine\ORM\EntityRepository;
8
use Uxmp\Core\Orm\Model\Session;
9
use Uxmp\Core\Orm\Model\SessionInterface;
10
11
/**
12
 * @extends EntityRepository<Session>
13
 *
14
 * @method null|SessionInterface findOneBy(mixed[] $criteria)
15
 */
16
final class SessionRepository extends EntityRepository implements SessionRepositoryInterface
17
{
18 1
    public function prototype(): SessionInterface
19
    {
20 1
        return new Session();
21
    }
22
23 1
    public function save(SessionInterface $session): void
24
    {
25 1
        $this->getEntityManager()->persist($session);
26 1
        $this->getEntityManager()->flush();
27
    }
28
29 1
    public function delete(SessionInterface $session): void
30
    {
31 1
        $this->getEntityManager()->remove($session);
32 1
        $this->getEntityManager()->flush();
33
    }
34
}
35