Passed
Push — master ( 0a354e...300378 )
by Nico
37:07 queued 24:59
created

ColonyClassRestrictionRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 20
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 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 Override;
0 ignored issues
show
Bug introduced by
The type Override was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Stu\Orm\Entity\ColonyClassInterface;
10
use Stu\Orm\Entity\ColonyClassRestriction;
11
use Stu\Orm\Entity\ColonyClassRestrictionInterface;
12
use Stu\Orm\Entity\TerraformingInterface;
13
use Stu\Orm\Entity\BuildingInterface;
14
15
/**
16
 * @extends EntityRepository<ColonyClassRestriction>
17
 */
18
final class ColonyClassRestrictionRepository extends EntityRepository implements ColonyClassRestrictionRepositoryInterface
19
{
20
    #[Override]
21
    public function prototype(): ColonyClassRestrictionInterface
22
    {
23
        return new ColonyClassRestriction();
24
    }
25
26
    #[Override]
27
    public function save(ColonyClassRestrictionInterface $restriction): void
28
    {
29
        $em = $this->getEntityManager();
30
        $em->persist($restriction);
31
    }
32
33
    #[Override]
34
    public function delete(ColonyClassRestrictionInterface $restriction): void
35
    {
36
        $em = $this->getEntityManager();
37
        $em->remove($restriction);
38
    }
39
}