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

SystemScanPanelEntry   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 27
ccs 0
cts 12
cp 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isClickAble() 0 3 1
A getOnClick() 0 8 1
A __construct() 0 8 1
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