Completed
Push — master ( cb16b1...c87003 )
by Ricardo
04:25 queued 25s
created

DefaultRenderer::renderVideoEmbedCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.6666
c 1
b 0
f 1
cc 1
eloc 6
nc 1
nop 3
crap 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 2
    public function renderVideoEmbedCode($embedUrl, $width, $height)
24
    {
25 2
        return sprintf(
26 2
            '<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 2
            $width,
28 2
            $height,
29 2
            addslashes($embedUrl)
30 2
        );
31
    }
32
}
33