Passed
Push — dev ( 840a26...5b15b7 )
by Janko
18:04
created

AnomalyRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A prototype() 0 3 1
A save() 0 5 1
A delete() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Orm\Repository;
6
7
use Doctrine\ORM\EntityRepository;
8
use Stu\Orm\Entity\Anomaly;
9
use Stu\Orm\Entity\AnomalyInterface;
10
11
/**
12
 * @extends EntityRepository<Anomaly>
13
 */
14
final class AnomalyRepository extends EntityRepository implements AnomalyRepositoryInterface
15
{
16
    public function prototype(): AnomalyInterface
17
    {
18
        return new Anomaly();
19
    }
20
21
    public function save(AnomalyInterface $anomaly): void
22
    {
23
        $em = $this->getEntityManager();
24
25
        $em->persist($anomaly);
26
    }
27
28
    public function delete(AnomalyInterface $anomaly): void
29
    {
30
        $em = $this->getEntityManager();
31
32
        $em->remove($anomaly);
33
    }
34
}
35