Passed
Push — main ( d7832a...2d8ac8 )
by Daniel
04:45
created

GenreRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 18
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A prototype() 0 4 1
A save() 0 4 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 JetBrains\PhpStorm\Pure;
9
use Uxmp\Core\Orm\Model\Genre;
10
use Uxmp\Core\Orm\Model\GenreInterface;
11
12
/**
13
 * @extends EntityRepository<GenreInterface>
14
 *
15
 * @method null|GenreInterface findOneBy(mixed[] $criteria)
16
 */
17
final class GenreRepository extends EntityRepository implements GenreRepositoryInterface
18
{
19
    #[Pure]
20
    public function prototype(): GenreInterface
21
    {
22
        return new Genre();
23
    }
24
25
    public function save(GenreInterface $genre): void
26
    {
27
        $this->getEntityManager()->persist($genre);
28
        $this->getEntityManager()->flush();
29
    }
30
31
    public function delete(GenreInterface $genre): void
32
    {
33
        $this->getEntityManager()->remove($genre);
34
        $this->getEntityManager()->flush();
35
    }
36
}
37