| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | public function toHtml(array $attributes = []): string |
||
| 36 | { |
||
| 37 | unset($attributes['src']); |
||
| 38 | $htmlAttributes = []; |
||
| 39 | foreach ($attributes as $key => $value) { |
||
| 40 | $htmlAttributes[] = "$key=\"$value\""; |
||
| 41 | } |
||
| 42 | |||
| 43 | return |
||
| 44 | sprintf( |
||
| 45 | "<img src=\"data:%s;base64,%s\" %s></img>", |
||
| 46 | $this->mimeType(), |
||
| 47 | $this->imageBase64(), |
||
| 48 | implode(' ', $htmlAttributes) |
||
| 49 | ); |
||
| 52 |