Completed
Push — master ( c2eaed...db6d82 )
by Tom
08:01
created
src/Property/Content.php 1 patch
Braces   +16 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,15 +18,20 @@  discard block
 block discarded – undo
18 18
 	}
19 19
 
20 20
 	public function run($value, \DomElement $element, \Transphporm\Hook\PropertyHook $rule) {
21
-		if ($element->getAttribute('transphporm') === 'remove') return;
21
+		if ($element->getAttribute('transphporm') === 'remove') {
22
+			return;
23
+		}
22 24
 				
23 25
 		$value = $this->formatter->format($value, $rule->getRules());
24 26
 		if (!$this->processPseudo($value, $element, $rule)) {
25 27
 			//Remove the current contents
26 28
 			$this->removeAllChildren($element);
27 29
 			//Now make a text node
28
-			if ($this->getContentMode($rule->getRules()) === 'replace') $this->replaceContent($element, $value);
29
-			else $this->appendContent($element, $value);
30
+			if ($this->getContentMode($rule->getRules()) === 'replace') {
31
+				$this->replaceContent($element, $value);
32
+			} else {
33
+				$this->appendContent($element, $value);
34
+			}
30 35
 		}
31 36
 	}
32 37
 
@@ -55,8 +60,11 @@  discard block
 block discarded – undo
55 60
 
56 61
 	private function getNode($node, $document) {
57 62
 		foreach ($node as $n) {
58
-			if ($n instanceof \DomNode) yield $document->importNode($n, true);
59
-			else yield $document->createTextNode($n);
63
+			if ($n instanceof \DomNode) {
64
+				yield $document->importNode($n, true);
65
+			} else {
66
+				yield $document->createTextNode($n);
67
+			}
60 68
 		}
61 69
 	}
62 70
 
@@ -103,6 +111,8 @@  discard block
 block discarded – undo
103 111
 	}
104 112
 
105 113
 	private function removeAllChildren($element) {
106
-		while ($element->hasChildNodes()) $element->removeChild($element->firstChild);
114
+		while ($element->hasChildNodes()) {
115
+			$element->removeChild($element->firstChild);
116
+		}
107 117
 	}
108 118
 }
109 119
\ No newline at end of file
Please login to merge, or discard this patch.