Completed
Push — master ( f0d6df...a6fc67 )
by Tom
01:53
created
src/FunctionSet.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@
 block discarded – undo
28 28
 			$tokens = $args[0];
29 29
 			$parser = new \Transphporm\Parser\Value($this);
30 30
 			return $parser->parseTokens($tokens, $this->elementData->getData($this->element));
31
-		}
32
-		else {
31
+		} else {
33 32
 			return iterator_to_array($args[0]);
34 33
 		}
35 34
 
Please login to merge, or discard this patch.
src/TSSValidator.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,14 +13,17 @@  discard block
 block discarded – undo
13 13
         $this->error = null;
14 14
         $tokens = $this->tokenize($tss);
15 15
 
16
-        foreach ($tokens as $token)
17
-            if (!$this->validateRule($token)) return false;
16
+        foreach ($tokens as $token) {
17
+                    if (!$this->validateRule($token)) return false;
18
+        }
18 19
 
19 20
         return true;
20 21
     }
21 22
 
22 23
     private function validateRule($token) {
23
-        if ($token['type'] !== Tokenizer::OPEN_BRACE) return true;
24
+        if ($token['type'] !== Tokenizer::OPEN_BRACE) {
25
+        	return true;
26
+        }
24 27
 
25 28
         return $this->checkBraces($token) && $this->checkSemicolons($token)
26 29
             && $this->checkParenthesis($token);
@@ -33,8 +36,9 @@  discard block
 block discarded – undo
33 36
     private function checkSemicolons($braceToken) {
34 37
         $splitTokens = $braceToken['value']->splitOnToken(Tokenizer::COLON);
35 38
         array_shift($splitTokens); array_pop($splitTokens);
36
-        foreach ($splitTokens as $tokens)
37
-            if (!in_array(Tokenizer::SEMI_COLON, array_column(iterator_to_array($tokens), 'type'))) return false;
39
+        foreach ($splitTokens as $tokens) {
40
+                    if (!in_array(Tokenizer::SEMI_COLON, array_column(iterator_to_array($tokens), 'type'))) return false;
41
+        }
38 42
 
39 43
         return true;
40 44
     }
@@ -44,7 +48,9 @@  discard block
 block discarded – undo
44 48
     }
45 49
 
46 50
     private function tokenize($tss) {
47
-        if (is_file($tss)) $tss = file_get_contents($tss);
51
+        if (is_file($tss)) {
52
+        	$tss = file_get_contents($tss);
53
+        }
48 54
         return (new Parser\Tokenizer($tss))->getTokens();
49 55
     }
50 56
 }
Please login to merge, or discard this patch.
src/FilePath.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,14 +18,20 @@
 block discarded – undo
18 18
 	}
19 19
 
20 20
 	public function getFilePath($filePath) {
21
-		if (is_file($filePath)) return $filePath;
22
-		else if (is_file($this->baseDir . DIRECTORY_SEPARATOR . $filePath)) return $this->baseDir . DIRECTORY_SEPARATOR . $filePath;
23
-		else return $this->loadFromPaths($filePath);
21
+		if (is_file($filePath)) {
22
+			return $filePath;
23
+		} else if (is_file($this->baseDir . DIRECTORY_SEPARATOR . $filePath)) {
24
+			return $this->baseDir . DIRECTORY_SEPARATOR . $filePath;
25
+		} else {
26
+			return $this->loadFromPaths($filePath);
27
+		}
24 28
 	}
25 29
 
26 30
 	private function loadFromPaths($filePath) {
27 31
 		foreach ($this->paths as $path) {
28
-			if (is_file($path . DIRECTORY_SEPARATOR . $filePath)) return $path . DIRECTORY_SEPARATOR . $filePath;
32
+			if (is_file($path . DIRECTORY_SEPARATOR . $filePath)) {
33
+				return $path . DIRECTORY_SEPARATOR . $filePath;
34
+			}
29 35
 		}
30 36
 
31 37
 		throw new \Exception('File ' . $filePath . ' not found in paths (' . implode(', ', $this->paths) . ')');
Please login to merge, or discard this patch.