Passed
Push — dev ( 98511f...00baf5 )
by Janko
15:17
created

SpacecrafCharacteristicsTrait::isShuttle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Stu\Component\Spacecraft\Trait;
4
5
use Stu\Component\Spacecraft\SpacecraftRumpEnum;
0 ignored issues
show
Bug introduced by
The type Stu\Component\Spacecraft\SpacecraftRumpEnum 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...
6
use Stu\Orm\Entity\StationInterface;
7
8
trait SpacecrafCharacteristicsTrait
9
{
10
    use SpacecraftTrait;
11
12 7
    public function isStation(): bool
13
    {
14 7
        return $this->getThis() instanceof StationInterface;
15
    }
16
17 1
    public function isShuttle(): bool
18
    {
19 1
        return $this->getThis()->getRump()->getCategoryId() === SpacecraftRumpEnum::SHIP_CATEGORY_SHUTTLE;
20
    }
21
22 2
    public function isConstruction(): bool
23
    {
24 2
        return $this->getThis()->getRump()->getCategoryId() === SpacecraftRumpEnum::SHIP_CATEGORY_CONSTRUCTION;
25
    }
26
27
    public function hasEscapePods(): bool
28
    {
29
        return $this->getThis()->getRump()->isEscapePods() && $this->getCrewCount() > 0;
0 ignored issues
show
Bug introduced by
It seems like getCrewCount() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
        return $this->getThis()->getRump()->isEscapePods() && $this->/** @scrutinizer ignore-call */ getCrewCount() > 0;
Loading history...
30
    }
31
}
32