Completed
Push — master ( 71d00a...353714 )
by Tom
02:18
created
src/Parser/Sheet.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@  discard block
 block discarded – undo
33 33
 			$rules = $this->writeRule($rules, $selector, $rule);
34 34
 		}
35 35
 		//there may be processing instructions at the end
36
-		if ($processing = $this->processingInstructions($this->tss, $pos, strlen($this->tss), count($rules)+$indexStart)) $rules = array_merge($rules, $processing['rules']);
36
+		if ($processing = $this->processingInstructions($this->tss, $pos, strlen($this->tss), count($rules)+$indexStart)) {
37
+			$rules = array_merge($rules, $processing['rules']);
38
+		}
37 39
 		usort($rules, [$this, 'sortRules']);
38 40
 		return $rules;
39 41
 	}
@@ -63,8 +65,7 @@  discard block
 block discarded – undo
63 65
 				$pos = strpos($tss, ';', $spacePos);
64 66
 				$args = substr($tss, $spacePos+1, $pos-$spacePos-1);
65 67
 				$rules = array_merge($rules, $this->$funcName($args, $indexStart));
66
-			}
67
-			else {
68
+			} else {
68 69
 				break;	
69 70
 			} 
70 71
 		}
@@ -79,7 +80,9 @@  discard block
 block discarded – undo
79 80
 
80 81
 	private function sortRules($a, $b) {
81 82
 		//If they have the same depth, compare on index
82
-		if ($a->depth === $b->depth) return $a->index < $b->index ? -1 : 1;
83
+		if ($a->depth === $b->depth) {
84
+			return $a->index < $b->index ? -1 : 1;
85
+		}
83 86
 
84 87
 		return ($a->depth < $b->depth) ? -1 : 1;
85 88
 	}
@@ -100,7 +103,9 @@  discard block
 block discarded – undo
100 103
 		$return = [];
101 104
 
102 105
 		foreach ($rules as $rule) {
103
-			if (trim($rule) === '') continue;
106
+			if (trim($rule) === '') {
107
+				continue;
108
+			}
104 109
 			$parts = explode(':', $rule, 2);
105 110
 
106 111
 			$parts[1] = $stringExtractor->rebuild($parts[1]);
Please login to merge, or discard this patch.