Display   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 7
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 5 3
1
<?php
2
/* @description     Transformation Style Sheets - Revolutionising PHP templating    *
3
 * @author          Tom Butler [email protected]                                             *
4
 * @copyright       2017 Tom Butler <[email protected]> | https://r.je/                      *
5
 * @license         http://www.opensource.org/licenses/bsd-license.php  BSD License *
6
 * @version         1.2                                                             */
7
namespace Transphporm\Property;
8
class Display implements \Transphporm\Property {
9
	public function run(array $values, \DomElement $element, array $rules, \Transphporm\Hook\PseudoMatcher $pseudoMatcher, array $properties = []) {
10
		if ($pseudoMatcher->hasFunction('attr')) $element->removeAttribute($pseudoMatcher->getFuncArgs('attr')[0]);
11
		else if (strtolower($values[0]) === 'none') $element->setAttribute('transphporm', 'remove');
12
		else $element->setAttribute('transphporm', 'show');
13
	}
14
}
15