Passed
Push — dev ( 766009...bcc49c )
by Janko
09:42
created

ResearchStateFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 32
dl 0
loc 59
ccs 0
cts 23
cp 0
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createResearchState() 0 13 1
A __construct() 0 22 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Research;
6
7
use Doctrine\ORM\EntityManagerInterface;
8
use Stu\Component\Ship\System\ShipSystemManagerInterface;
9
use Stu\Module\Award\Lib\CreateUserAwardInterface;
10
use Stu\Module\Crew\Lib\CrewCreatorInterface;
11
use Stu\Module\Database\Lib\CreateDatabaseEntryInterface;
12
use Stu\Module\Message\Lib\PrivateMessageSenderInterface;
13
use Stu\Module\Ship\Lib\ShipCreatorInterface;
14
use Stu\Orm\Repository\ResearchedRepositoryInterface;
15
use Stu\Orm\Repository\ShipRepositoryInterface;
16
use Stu\Orm\Repository\ShipRumpUserRepositoryInterface;
17
18
final class ResearchStateFactory implements ResearchStateFactoryInterface
19
{
20
    private ResearchedRepositoryInterface $researchedRepository;
21
22
    private ShipRumpUserRepositoryInterface $shipRumpUserRepository;
23
24
    private PrivateMessageSenderInterface $privateMessageSender;
25
26
    private CreateDatabaseEntryInterface $createDatabaseEntry;
27
28
    private CrewCreatorInterface $crewCreator;
29
30
    private ShipCreatorInterface $shipCreator;
31
32
    private ShipRepositoryInterface $shipRepository;
33
34
    private ShipSystemManagerInterface $shipSystemManager;
35
36
    private EntityManagerInterface $entityManager;
37
38
    private CreateUserAwardInterface $createUserAward;
39
40
    public function __construct(
41
        ResearchedRepositoryInterface $researchedRepository,
42
        ShipRumpUserRepositoryInterface $shipRumpUserRepository,
43
        PrivateMessageSenderInterface $privateMessageSender,
44
        CreateDatabaseEntryInterface $createDatabaseEntry,
45
        CrewCreatorInterface $crewCreator,
46
        ShipCreatorInterface $shipCreator,
47
        ShipRepositoryInterface $shipRepository,
48
        ShipSystemManagerInterface $shipSystemManager,
49
        CreateUserAwardInterface $createUserAward,
50
        EntityManagerInterface $entityManager
51
    ) {
52
        $this->researchedRepository = $researchedRepository;
53
        $this->shipRumpUserRepository = $shipRumpUserRepository;
54
        $this->privateMessageSender = $privateMessageSender;
55
        $this->createDatabaseEntry = $createDatabaseEntry;
56
        $this->crewCreator = $crewCreator;
57
        $this->shipCreator = $shipCreator;
58
        $this->shipRepository = $shipRepository;
59
        $this->shipSystemManager = $shipSystemManager;
60
        $this->entityManager = $entityManager;
61
        $this->createUserAward = $createUserAward;
62
    }
63
64
    public function createResearchState(): ResearchStateInterface
65
    {
66
        return new ResearchState(
67
            $this->researchedRepository,
68
            $this->shipRumpUserRepository,
69
            $this->privateMessageSender,
70
            $this->createDatabaseEntry,
71
            $this->crewCreator,
72
            $this->shipCreator,
73
            $this->shipRepository,
74
            $this->shipSystemManager,
75
            $this->createUserAward,
76
            $this->entityManager,
77
        );
78
    }
79
}
80