Conditions | 4 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function getHtml(): ?string |
||
31 | { |
||
32 | if (\count($this->elements) === 0) { |
||
33 | return null; |
||
34 | } |
||
35 | $renderedElements = []; |
||
36 | $position = 0; |
||
37 | foreach ($this->elements as $url => $name) { |
||
38 | $position++; |
||
39 | $element = $element = sprintf(self::HTML_SPAN, $name) . sprintf(self::HTML_META_POSITION, $position); |
||
|
|||
40 | if (!is_numeric($url)) { |
||
41 | $element = sprintf(self::HTML_A, $url, $element); |
||
42 | } |
||
43 | $renderedElements[] = sprintf(self::HTML_LI, $element); |
||
44 | } |
||
45 | |||
46 | return sprintf( |
||
47 | self::HTML_OL, |
||
48 | $this->cssClass, |
||
49 | $this->mainId, |
||
50 | implode($renderedElements) |
||
51 | ); |
||
66 |