Flag   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 14
ccs 9
cts 9
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 12 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Del\Helper;
6
7
use Del\Image;
8
use Del\Entity\Country;
9
10
class Flag
11
{
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
    }
25
}
26