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

ResearchStateFactory::createResearchState()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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