Completed
Push — master ( 415647...d02380 )
by Ricardo
02:50
created

DefaultRenderer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 25
ccs 0
cts 9
cp 0
rs 10
c 1
b 0
f 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A renderVideoEmbedCode() 0 9 1
1
<?php
2
/**
3
 * @author Ricardo Fiorani
4
 */
5
6
namespace RicardoFiorani\Renderer;
7
8
class DefaultRenderer implements EmbedRendererInterface
9
{
10
    /**
11
     * A friend once told me that html inside strings
12
     * isn't a good thing, but god knows I trying
13
     * to make it not dependant of some html element generator
14
     * and I'm too lazy/unnecessary to make one of these on my own.
15
     * Edit: The best I could do is do an sprintf, so...
16
     *
17
     * @param string $embedUrl
18
     * @param int $width
19
     * @param int $height
20
     *
21
     * @return string
22
     */
23
    public function renderVideoEmbedCode($embedUrl, $width, $height)
24
    {
25
        return sprintf(
26
            '<iframe width="%s" height="%s" src="%s" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 137 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
27
            $width,
28
            $height,
29
            addslashes($embedUrl)
30
        );
31
    }
32
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
33