Passed
Pull Request — master (#1819)
by Nico
52:14 queued 25:19
created

SingletonBattleParty   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 20
ccs 0
cts 7
cp 0
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isBase() 0 3 1
A __construct() 0 6 1
A initMembers() 0 3 1
1
<?php
2
3
namespace Stu\Module\Ship\Lib\Battle\Party;
4
5
use Doctrine\Common\Collections\Collection;
6
use Stu\Module\Ship\Lib\ShipWrapperInterface;
7
8
class SingletonBattleParty extends AbstractBattleParty
9
{
10
    private bool $isBase;
11
12
    public function __construct(
13
        ShipWrapperInterface $leader
14
    ) {
15
        parent::__construct($leader);
16
17
        $this->isBase = $leader->get()->isBase();
18
    }
19
20
    public function initMembers(): Collection
21
    {
22
        return $this->createSingleton($this->leader);
23
    }
24
25
    public function isBase(): bool
26
    {
27
        return $this->isBase;
28
    }
29
}
30