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

DefaultRenderer::renderVideoEmbedCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 9
ccs 0
cts 9
cp 0
rs 9.6666
c 1
b 0
f 1
cc 1
eloc 6
nc 1
nop 3
crap 2
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