Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
20 | 1 | public static function render(Country $country, $size) |
|
21 | { |
||
22 | 1 | $path = dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.'flags'.DIRECTORY_SEPARATOR.$size.DIRECTORY_SEPARATOR; |
|
23 | 1 | $img = new Image($path.$country->getFlag()); |
|
24 | 1 | $header = $img->getHeader(); |
|
25 | |||
26 | 1 | ob_start(); |
|
27 | 1 | $img->output(); |
|
28 | 1 | $img->destroy(); |
|
29 | 1 | $i = ob_get_clean(); |
|
30 | |||
31 | 1 | return( '<img src="data:'.$header.';base64,' . base64_encode( $i ).'" />'); |
|
32 | } |
||
33 | } |