Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
15 | 1 | public function render() |
|
16 | { |
||
17 | 1 | foreach ($this->runXpathQuery('//youtube') as $node) { |
|
18 | /* @var $node DOMElement */ |
||
19 | 1 | $parent = $node->parentNode; |
|
20 | |||
21 | 1 | $fragment = $this->getDocument()->createDocumentFragment(); |
|
22 | |||
23 | 1 | $id = $node->getAttribute('id'); |
|
24 | |||
25 | $xml = <<<EOT |
||
26 | <div class="videoWrapper"> |
||
27 | <iframe src="http://www.youtube.com/embed/$id" frameborder="0"></iframe> |
||
28 | 1 | </div> |
|
29 | 1 | EOT; |
|
30 | |||
31 | 1 | $fragment->appendXML($xml); |
|
32 | |||
33 | 1 | $parent->replaceChild($fragment, $node); |
|
34 | 1 | } |
|
35 | 1 | } |
|
36 | } |
||
37 |