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