Completed
Pull Request — master (#203)
by
unknown
01:54
created

ItemStyleTrait::setMarkerOff()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 3
c 1
b 1
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
namespace PhpSchool\CliMenu\Style;
4
5
trait ItemStyleTrait
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $markerOn;
11
12
    /**
13
     * @var string
14
     */
15
    protected $markerOff;
16
17
    /**
18
     * @var string
19
     */
20
    protected $itemExtra;
21
22
    /**
23
     * @var bool
24
     */
25
    protected $displaysExtra;
26
27
    protected $custom = false;
28
29
    public function getIsCustom() : bool
30
    {
31
        return $this->custom;
32
    }
33
34
    public function getMarker(bool $selected) : string
35
    {
36
        return $selected ? $this->markerOn : $this->markerOff;
37
    }
38
39
    public function getMarkerOn() : string
40
    {
41
        return $this->markerOn;
42
    }
43
44
    public function setMarkerOn(string $marker) : self
45
    {
46
        $this->custom = true;
47
48
        $this->markerOn = $marker;
49
50
        return $this;
51
    }
52
53
    public function getMarkerOff() : string
54
    {
55
        return $this->markerOff;
56
    }
57
58
    public function setMarkerOff(string $marker) : self
59
    {
60
        $this->custom = true;
61
62
        $this->markerOff = $marker;
63
64
        return $this;
65
    }
66
67
    public function getItemExtra() : string
68
    {
69
        return $this->itemExtra;
70
    }
71
72
    public function setItemExtra(string $itemExtra) : self
73
    {
74
        $this->custom = true;
75
76
        $this->itemExtra = $itemExtra;
77
78
        return $this;
79
    }
80
81
    public function getDisplaysExtra() : bool
82
    {
83
        return $this->displaysExtra;
84
    }
85
86
    public function setDisplaysExtra(bool $displaysExtra) : self
87
    {
88
        $this->custom = true;
89
90
        $this->displaysExtra = $displaysExtra;
91
92
        return $this;
93
    }
94
}
95