RadioStationRepository   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A prototype() 0 3 1
A delete() 0 4 1
A save() 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\RadioStation;
9
use Uxmp\Core\Orm\Model\RadioStationInterface;
10
11
/**
12
 * @extends EntityRepository<RadioStation>
13
 *
14
 * @method null|RadioStationInterface find(mixed $id)
15
 */
16
final class RadioStationRepository extends EntityRepository implements RadioStationRepositoryInterface
17
{
18
    /**
19
     * Create a new RadioStation instance
20
     */
21 1
    public function prototype(): RadioStationInterface
22
    {
23 1
        return new RadioStation();
24
    }
25
26
    /**
27
     * Saves the RadioStation
28
     */
29 1
    public function save(RadioStationInterface $station): void
30
    {
31 1
        $this->getEntityManager()->persist($station);
32 1
        $this->getEntityManager()->flush();
33
    }
34
35
    /**
36
     * Deletes the RadioStation
37
     */
38 1
    public function delete(RadioStationInterface $station): void
39
    {
40 1
        $this->getEntityManager()->remove($station);
41 1
        $this->getEntityManager()->flush();
42
    }
43
}
44