Completed
Push — master ( 8f1125...aa557b )
by Tom
02:47
created
src/CssToXpath.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 				$parts = array_map(function($val) {
42 42
 					return implode($this->valueParser->parse($val));
43 43
 				}, $parts);
44
-				if (isset($parts[1])) $parts[1] = '"' . $parts[1] . '"';
44
+				if (isset($parts[1])) {
45
+					$parts[1] = '"' . $parts[1] . '"';
46
+				}
45 47
 				return implode($comparator, $parts);
46 48
 			}
47 49
 		}
@@ -60,8 +62,9 @@  discard block
 block discarded – undo
60 62
 				$selector = $this->createSelector();
61 63
 				$selector->type = $css[$i];
62 64
 				$selectors[] = $selector;
65
+			} else {
66
+				$selector->string .= $css[$i];
63 67
 			}
64
-			else $selector->string .= $css[$i];			
65 68
 		}
66 69
 		return $selectors;
67 70
 	}
@@ -72,7 +75,9 @@  discard block
 block discarded – undo
72 75
 		$this->depth = count($selectors);
73 76
 		$xpath = '/';
74 77
 		foreach ($selectors as $selector) {
75
-			if (isset($this->translators[$selector->type])) $xpath .= $this->translators[$selector->type]($selector->string);
78
+			if (isset($this->translators[$selector->type])) {
79
+				$xpath .= $this->translators[$selector->type]($selector->string);
80
+			}
76 81
 		}
77 82
 
78 83
 		$xpath = str_replace('/[', '/*[', $xpath);
Please login to merge, or discard this patch.