Passed
Push — dev ( f78319...bf5915 )
by Janko
05:17
created

IncomingBattleParty::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Stu\Module\Spacecraft\Lib\Battle\Party;
4
5
use Doctrine\Common\Collections\Collection;
6
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...
7
use Stu\Module\Spacecraft\Lib\SpacecraftWrapperInterface;
8
9
class IncomingBattleParty extends AbstractBattleParty
10
{
11 9
    #[Override]
12
    public function initMembers(): Collection
13
    {
14 9
        $fleetWrapper = $this->leader->getFleetWrapper();
15
16 9
        $result = $fleetWrapper === null ? $this->createSingleton($this->leader) : $fleetWrapper->getShipWrappers();
17
18
        // filter warped and cloaked
19 9
        return $result
20 9
            ->filter(fn(SpacecraftWrapperInterface $wrapper): bool =>
21 9
            !$wrapper->get()->isCloaked() && !$wrapper->get()->isWarped());
22
    }
23
}
24