Passed
Push — dev ( 1dcdd9...74922b )
by Janko
06:48
created

ResearchStateFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 20%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 21
ccs 2
cts 10
cp 0.2
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createResearchState() 0 10 1
A __construct() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Research;
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\Module\Award\Lib\CreateUserAwardInterface;
9
use Stu\Module\Database\Lib\CreateDatabaseEntryInterface;
10
use Stu\Module\Message\Lib\PrivateMessageSenderInterface;
11
use Stu\Module\Ship\Lib\ShipCreatorInterface;
12
use Stu\Orm\Repository\ResearchedRepositoryInterface;
13
use Stu\Orm\Repository\ShipRumpUserRepositoryInterface;
14
15
final class ResearchStateFactory implements ResearchStateFactoryInterface
16
{
17 1
    public function __construct(
18
        private readonly ResearchedRepositoryInterface $researchedRepository,
19
        private readonly ShipRumpUserRepositoryInterface $shipRumpUserRepository,
20
        private readonly PrivateMessageSenderInterface $privateMessageSender,
21
        private readonly CreateDatabaseEntryInterface $createDatabaseEntry,
22
        private readonly ShipCreatorInterface $shipCreator,
23
        private readonly CreateUserAwardInterface $createUserAward
24 1
    ) {}
25
26
    #[Override]
27
    public function createResearchState(): ResearchStateInterface
28
    {
29
        return new ResearchState(
30
            $this->researchedRepository,
31
            $this->shipRumpUserRepository,
32
            $this->privateMessageSender,
33
            $this->createDatabaseEntry,
34
            $this->shipCreator,
35
            $this->createUserAward
36
        );
37
    }
38
}
39