1 | <?php |
||
14 | class AsciiArtItem implements MenuItemInterface |
||
15 | { |
||
16 | /** |
||
17 | * Possible positions of the ascii art |
||
18 | */ |
||
19 | const POSITION_CENTER = 'center'; |
||
20 | const POSITION_LEFT = 'left'; |
||
21 | const POSITION_RIGHT = 'right'; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | private $text; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $position; |
||
32 | |||
33 | /** |
||
34 | * @var int |
||
35 | */ |
||
36 | private $artLength; |
||
37 | |||
38 | /** |
||
39 | * @param string $text |
||
40 | * @param string $position |
||
41 | */ |
||
42 | public function __construct($text, $position = self::POSITION_CENTER) |
||
51 | |||
52 | /** |
||
53 | * The output text for the item |
||
54 | * |
||
55 | * @param MenuStyle $style |
||
56 | * @param bool $selected |
||
57 | * @return array |
||
58 | */ |
||
59 | public function getRows(MenuStyle $style, $selected = false) |
||
88 | |||
89 | /** |
||
90 | * Can the item be selected |
||
91 | * |
||
92 | * @return bool |
||
93 | */ |
||
94 | public function canSelect() |
||
98 | |||
99 | /** |
||
100 | * Execute the items callable if required |
||
101 | * |
||
102 | * @return void |
||
103 | */ |
||
104 | public function getSelectAction() |
||
108 | |||
109 | /** |
||
110 | * Return the raw string of text |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | public function getText() |
||
118 | |||
119 | /** |
||
120 | * Return the length of the art |
||
121 | * |
||
122 | * @return int |
||
123 | */ |
||
124 | public function getArtLength() |
||
128 | |||
129 | /** |
||
130 | * Whether or not the menu item is showing the menustyle extra value |
||
131 | * |
||
132 | * @return bool |
||
133 | */ |
||
134 | public function showsItemExtra() |
||
138 | |||
139 | /** |
||
140 | * Enable showing item extra |
||
141 | * |
||
142 | */ |
||
143 | public function showItemExtra() |
||
147 | |||
148 | /** |
||
149 | * Disable showing item extra |
||
150 | * |
||
151 | */ |
||
152 | public function hideItemExtra() |
||
156 | } |
||
157 |
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.