Passed
Pull Request — master (#2083)
by Nico
25:03 queued 14:54
created

ColonyClassRestrictionRepository::save()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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