Completed
Pull Request — master (#7)
by
unknown
05:22
created

GoogleMapsConverter::toHtml()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
namespace Sioen\JsonToHtml;
4
5
final class GoogleMapsConverter implements Converter
6
{
7
    public function toHtml(array $data)
8
    {
9
        return sprintf(
10
            '<iframe src="https://www.google.com/maps?q=%s,%s&output=embed" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>',
11
            $data['lat'],
12
            $data['lng']
13
        );
14
    }
15
16
    public function matches($type)
17
    {
18
        return $type === 'google_maps';
19
    }
20
}
21