Completed
Push — master ( ed7d82...0b58b7 )
by Tom
02:40
created

PostProcess::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4286
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
/* @description     Transformation Style Sheets - Revolutionising PHP templating    *
3
 * @author          Tom Butler [email protected]                                             *
4
 * @copyright       2015 Tom Butler <[email protected]> | https://r.je/                      *
5
 * @license         http://www.opensource.org/licenses/bsd-license.php  BSD License *
6
 * @version         0.9                                                             */
7
namespace Transphporm\Hook;
8
/** Hooks into the template system, gets assigned as `ul li` or similar and `run()` is called with any elements that match */
9
class PostProcess implements \Transphporm\Hook {
10
	public function run(\DomElement $element) {
11
		$transphporm = $element->getAttribute('transphporm');
12
		if ($transphporm == 'remove') $element->parentNode->removeChild($element);
13
		else $element->removeAttribute('transphporm');
14
	}
15
16
}