Passed
Push — dev ( e70ec0...18c4df )
by Nico
05:41
created

SpacecraftUiFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 25%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 17
ccs 2
cts 8
cp 0.25
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createWormholeRestrictionItem() 0 9 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Spacecraft\Lib;
6
7
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...
8
use Stu\Orm\Entity\WormholeRestriction;
9
use Stu\Orm\Repository\AllianceRepositoryInterface;
10
use Stu\Orm\Repository\FactionRepositoryInterface;
11
use Stu\Orm\Repository\UserRepositoryInterface;
12
13
final class SpacecraftUiFactory implements SpacecraftUiFactoryInterface
14
{
15 1
    public function __construct(
16
        private UserRepositoryInterface $userRepository,
17
        private AllianceRepositoryInterface $allianceRepository,
18
        private FactionRepositoryInterface $factionRepository
19 1
    ) {}
20
21
    #[Override]
22
    public function createWormholeRestrictionItem(
23
        WormholeRestriction $restriction
24
    ): WormholeRestrictionItem {
25
        return new WormholeRestrictionItem(
26
            $this->userRepository,
27
            $this->allianceRepository,
28
            $this->factionRepository,
29
            $restriction
30
        );
31
    }
32
}