Passed
Push — master ( 6b02b9...a180a6 )
by Nico
26:39 queued 18:43
created

SystemScanPanelEntry::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 7
ccs 0
cts 3
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Lib\Map\VisualPanel;
6
7
use Stu\Orm\Entity\StarSystemInterface;
8
9
class SystemScanPanelEntry extends SignaturePanelEntry
10
{
11
    private StarSystemInterface $system;
12
13
    public function __construct(
14
        VisualPanelEntryData $data,
15
        StarSystemInterface $system
16
    ) {
17
        parent::__construct($data, null, null);
18
19
        $this->system = $system;
20
    }
21
22
    public function isClickAble(): bool
23
    {
24
        return true;
25
    }
26
27
    public function getOnClick(): string
28
    {
29
        return sprintf(
30
            'showSectorScanWindow(this, %d, %d, %d, %s);',
31
            $this->data->getPosX(),
32
            $this->data->getPosY(),
33
            $this->system->getId(),
34
            'false'
35
        );
36
    }
37
}
38