Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | 1 | public static function render(Country $country, string $size): string |
|
13 | { |
||
14 | 1 | $path = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'img' . DIRECTORY_SEPARATOR . 'flags' . DIRECTORY_SEPARATOR . $size . DIRECTORY_SEPARATOR; |
|
15 | 1 | $img = new Image($path . $country->getFlag()); |
|
16 | 1 | $header = $img->getHeader(); |
|
17 | |||
18 | 1 | ob_start(); |
|
19 | 1 | $img->output(); |
|
20 | 1 | $img->destroy(); |
|
21 | 1 | $i = ob_get_clean(); |
|
22 | |||
23 | 1 | return ('<img src="data:' . $header . ';base64,' . base64_encode($i) . '" />'); |
|
24 | } |
||
26 |