Passed
Pull Request — master (#203)
by
unknown
02:08
created

StaticStyle   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 22
c 1
b 0
f 0
dl 0
loc 54
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setItemExtra() 0 3 1
A setMarkerOff() 0 3 1
A __construct() 0 3 1
A setMarkerOn() 0 3 1
A fromArray() 0 8 1
A toArray() 0 7 1
A setDisplaysExtra() 0 3 1
1
<?php
2
3
namespace PhpSchool\CliMenu\Style;
4
5
class StaticStyle implements ItemStyleInterface
6
{
7
    use ItemStyleTrait;
8
9
    protected const DEFAULT_STYLES = [
10
        'markerOn'      => '',
11
        'markerOff'     => '',
12
        'itemExtra'     => '',
13
        'displaysExtra' => false,
14
    ];
15
16
    public function __construct()
17
    {
18
        $this->fromArray([]);
19
    }
20
21
    public function setMarkerOn(string $marker) : self
22
    {
23
        return $this;
24
    }
25
26
    public function setMarkerOff(string $marker) : self
27
    {
28
        return $this;
29
    }
30
31
    public function setItemExtra(string $itemExtra) : self
32
    {
33
        return $this;
34
    }
35
36
    public function setDisplaysExtra(bool $displaysExtra) : self
37
    {
38
        return $this;
39
    }
40
41
    public function toArray(): array
42
    {
43
        return [
44
            'markerOn'      => $this->markerOn,
45
            'markerOff'     => $this->markerOff,
46
            'itemExtra'     => $this->itemExtra,
47
            'displaysExtra' => $this->displaysExtra,
48
        ];
49
    }
50
51
    public function fromArray(array $style) : self
0 ignored issues
show
Unused Code introduced by
The parameter $style is not used and could be removed. ( Ignorable by Annotation )

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

51
    public function fromArray(/** @scrutinizer ignore-unused */ array $style) : self

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
52
    {
53
        $this->markerOn      = self::DEFAULT_STYLES['markerOn'];
54
        $this->markerOff     = self::DEFAULT_STYLES['markerOff'];
55
        $this->itemExtra     = self::DEFAULT_STYLES['itemExtra'];
56
        $this->displaysExtra = self::DEFAULT_STYLES['displaysExtra'];
57
58
        return $this;
59
    }
60
}
61