Skip to content

Commit fb5a21a

Browse files
author
Ricardo Fiorani
committed
added support for newer php versions and small improvement on renderer
1 parent 1dc6ae0 commit fb5a21a

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ php:
88
- 5.5
99
- 5.6
1010
- 7.0
11+
- 7.1
12+
- 7.2
1113

1214
matrix:
1315
include:

src/Renderer/DefaultRenderer.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?php
22
/**
3-
* Created by PhpStorm.
4-
* User: Ricardo Fiorani
5-
* Date: 30/08/2015
6-
* Time: 00:55.
3+
* @author Ricardo Fiorani
74
*/
5+
86
namespace RicardoFiorani\Renderer;
97

108
class DefaultRenderer implements EmbedRendererInterface
@@ -13,18 +11,22 @@ class DefaultRenderer implements EmbedRendererInterface
1311
* A friend once told me that html inside strings
1412
* isn't a good thing, but god knows I trying
1513
* to make it not dependant of some html element generator
16-
* and too lazy to make one of these on my own.
17-
*
18-
*
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...
1916
*
2017
* @param string $embedUrl
21-
* @param int $width
22-
* @param int $height
18+
* @param int $width
19+
* @param int $height
2320
*
2421
* @return string
2522
*/
2623
public function renderVideoEmbedCode($embedUrl, $width, $height)
2724
{
28-
return '<iframe width="'.$width.'" height="'.$height.'" src="'.addslashes($embedUrl).'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
25+
return sprintf(
26+
'<iframe width="%s" height="%s" src="%s" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
27+
$width,
28+
$height,
29+
addslashes($embedUrl)
30+
);
2931
}
3032
}

0 commit comments

Comments
 (0)