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

SystemScanPanelEntry   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

3 Methods

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