Completed
Push — master ( 96a72e...fc1a4b )
by Tom
02:23
created
src/Parser/CssToXpath.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -50,6 +50,9 @@
 block discarded – undo
50 50
 		return $attr;
51 51
 	}
52 52
 
53
+	/**
54
+	 * @param string $comparator
55
+	 */
53 56
 	private static function compare($comparator, $a, $b) {
54 57
 		if ($comparator == '=') return $a == $b;
55 58
 		else if ($comparator == '!=') return $a != $b;
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,8 +51,11 @@  discard block
 block discarded – undo
51 51
 	}
52 52
 
53 53
 	private static function compare($comparator, $a, $b) {
54
-		if ($comparator == '=') return $a == $b;
55
-		else if ($comparator == '!=') return $a != $b;
54
+		if ($comparator == '=') {
55
+			return $a == $b;
56
+		} else if ($comparator == '!=') {
57
+			return $a != $b;
58
+		}
56 59
 	}
57 60
 
58 61
 	//split the css into indivudal functions
@@ -66,8 +69,9 @@  discard block
 block discarded – undo
66 69
 				$selector = $this->createSelector();
67 70
 				$selector->type = $css[$i];
68 71
 				$selectors[] = $selector;
72
+			} else {
73
+				$selector->string .= $css[$i];
69 74
 			}
70
-			else $selector->string .= $css[$i];			
71 75
 		}
72 76
 		return $selectors;
73 77
 	}
@@ -78,7 +82,9 @@  discard block
 block discarded – undo
78 82
 		$this->depth = count($selectors);
79 83
 		$xpath = '/';
80 84
 		foreach ($selectors as $selector) {
81
-			if (isset($this->translators[$selector->type])) $xpath .= $this->translators[$selector->type]($selector->string, $xpath);
85
+			if (isset($this->translators[$selector->type])) {
86
+				$xpath .= $this->translators[$selector->type]($selector->string, $xpath);
87
+			}
82 88
 		}
83 89
 
84 90
 		$xpath = str_replace('/[', '/*[', $xpath);
Please login to merge, or discard this patch.