Completed
Push — master ( 709b88...65d7f0 )
by Tom
10s
created
src/Parser/CssToXpath.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,8 +63,11 @@  discard block
 block discarded – undo
63 63
 	}
64 64
 
65 65
 	private static function compare($comparator, $a, $b) {
66
-		if ($comparator == '=') return $a == $b;
67
-		else if ($comparator == '!=') return $a != $b;
66
+		if ($comparator == '=') {
67
+			return $a == $b;
68
+		} else if ($comparator == '!=') {
69
+			return $a != $b;
70
+		}
68 71
 	}
69 72
 
70 73
 	//split the css into indivudal functions
@@ -78,8 +81,9 @@  discard block
 block discarded – undo
78 81
 				$selector = $this->createSelector();
79 82
 				$selector->type = $css[$i];
80 83
 				$selectors[] = $selector;
84
+			} else {
85
+				$selector->string .= $css[$i];
81 86
 			}
82
-			else $selector->string .= $css[$i];
83 87
 		}
84 88
 		return $selectors;
85 89
 	}
@@ -90,7 +94,9 @@  discard block
 block discarded – undo
90 94
 		$selectors = $this->split($css);
91 95
 		$xpath = '/';
92 96
 		foreach ($selectors as $selector) {
93
-			if (isset($this->translators[$selector->type])) $xpath .= $this->translators[$selector->type]($selector->string, $xpath);
97
+			if (isset($this->translators[$selector->type])) {
98
+				$xpath .= $this->translators[$selector->type]($selector->string, $xpath);
99
+			}
94 100
 		}
95 101
 
96 102
 		$xpath = str_replace('/[', '/*[', $xpath);
Please login to merge, or discard this patch.