Passed
Push — dev ( 48073e...2ba144 )
by Janko
16:20
created

ShipRumpModuleLevelRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 15
ccs 3
cts 6
cp 0.5
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A save() 0 6 1
A getByShipRump() 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\ShipRumpModuleLevel;
0 ignored issues
show
Bug introduced by
The type Stu\Orm\Entity\ShipRumpModuleLevel 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...
10
use Stu\Orm\Entity\ShipRumpModuleLevelInterface;
0 ignored issues
show
Bug introduced by
The type Stu\Orm\Entity\ShipRumpModuleLevelInterface 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...
11
use Stu\Orm\Entity\SpacecraftRumpInterface;
12
13
/**
14
 * @extends EntityRepository<ShipRumpModuleLevel>
15
 * 
16
 */
17
final class ShipRumpModuleLevelRepository extends EntityRepository implements ShipRumpModuleLevelRepositoryInterface
18
{
19
    #[Override]
20
    public function save(ShipRumpModuleLevelInterface $entity): void
21
    {
22
        $em = $this->getEntityManager();
23
24
        $em->persist($entity);
25
    }
26
27 4
    #[Override]
28
    public function getByShipRump(SpacecraftRumpInterface $rump): ?ShipRumpModuleLevelInterface
29
    {
30 4
        return $this->findOneBy([
31 4
            'rump' => $rump
32 4
        ]);
33
    }
34
}
35