Conditions | 5 |
Paths | 12 |
Total Lines | 28 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | protected function createMarkup(bool $saveToFile):string{ |
||
24 | $html = empty($this->options->cssClass) |
||
25 | ? '<div>' |
||
26 | : sprintf('<div class="%s">', $this->options->cssClass); |
||
27 | |||
28 | $html .= $this->options->eol; |
||
29 | |||
30 | foreach($this->matrix->matrix() as $row){ |
||
31 | $html .= '<div>'; |
||
32 | |||
33 | foreach($row as $M_TYPE){ |
||
34 | $html .= sprintf('<span style="background: %s;"></span>', $this->moduleValues[$M_TYPE]); |
||
35 | } |
||
36 | |||
37 | $html .= '</div>'.$this->options->eol; |
||
38 | } |
||
39 | |||
40 | $html .= '</div>'.$this->options->eol; |
||
41 | |||
42 | // wrap the snippet into a body when saving to file |
||
43 | if($saveToFile){ |
||
44 | $html = sprintf( |
||
45 | '<!DOCTYPE html><head><meta charset="UTF-8"><title>QR Code</title></head><body>%s</body>', |
||
46 | $this->options->eol.$html |
||
47 | ); |
||
48 | } |
||
49 | |||
50 | return $html; |
||
51 | } |
||
54 |