Passed
Push — dev ( 5010f4...52d0f1 )
by Janko
07:47
created

SystemScanPanelEntry::__construct()   A

Complexity

Conditions 1
Paths 1

Size

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