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

AnomalyRepository::save()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
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