Completed
Push — master ( 3edd40...9852e6 )
by Tom
03:35
created
src/Hook/PropertyHook.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,11 +23,15 @@  discard block
 block discarded – undo
23 23
 	public function run(\DomElement $element) {	
24 24
 		$this->functionSet->setElement($element);
25 25
 		//Don't run if there's a pseudo element like nth-child() and this element doesn't match it
26
-		if (!$this->pseudoMatcher->matches($element)) return;
26
+		if (!$this->pseudoMatcher->matches($element)) {
27
+			return;
28
+		}
27 29
 
28 30
 		foreach ($this->rules as $name => $value) {
29 31
 			$result = $this->callProperty($name, $element, $this->getArgs($value, $element));
30
-			if ($result === false) break;
32
+			if ($result === false) {
33
+				break;
34
+			}
31 35
 		}
32 36
 	}
33 37
 
@@ -40,8 +44,12 @@  discard block
 block discarded – undo
40 44
 	}
41 45
 
42 46
 	private function callProperty($name, $element, $value) {	
43
-		if (empty($value[0])) $value[0] = [];
44
-		if (isset($this->properties[$name])) return $this->properties[$name]->run($value, $element, $this->rules, $this->pseudoMatcher, $this->properties);
47
+		if (empty($value[0])) {
48
+			$value[0] = [];
49
+		}
50
+		if (isset($this->properties[$name])) {
51
+			return $this->properties[$name]->run($value, $element, $this->rules, $this->pseudoMatcher, $this->properties);
52
+		}
45 53
 		return false;
46 54
 	}
47 55
 }
Please login to merge, or discard this patch.