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

YoutubeConverter::toHtml()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace Sioen\JsonToHtml;
4
5
final class YoutubeConverter implements Converter
6
{
7
    public function toHtml(array $data)
8
    {
9
        return sprintf(
10
            '<iframe src="//www.youtube.com/embed/%s?rel=0" frameborder="0" allowfullscreen></iframe>',
11
            $data['remote_id']
12
        );
13
    }
14
15
    public function matches($type)
16
    {
17
        return $type === 'youtube';
18
    }
19
}
20