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

PostProcess   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 5 2
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
}