Passed
Pull Request — master (#5)
by Gerard van
06:43
created
src/Zicht/Tool/Script/Dumper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@
 block discarded – undo
32 32
 
33 33
                 foreach ($b->nodes as $n) {
34 34
                     if (null === $n) {
35
-                        $ret['nodes'][]= $n;
35
+                        $ret['nodes'][] = $n;
36 36
                     } else {
37
-                        if (! $n instanceof Node\Node) {
37
+                        if (!$n instanceof Node\Node) {
38 38
                             throw new \InvalidArgumentException("Invalid child node in " . Util::toPhp($path));
39 39
                         }
40
-                        $ret['nodes'][]= $this->getAst($n);
40
+                        $ret['nodes'][] = $this->getAst($n);
41 41
                     }
42 42
                 }
43 43
             }
Please login to merge, or discard this patch.
src/Zicht/Tool/Script/Tokenizer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
                 // match either '$(' or '@(' and mark that as an EXPR_START token.
46 46
                 if (preg_match('/^([$@])\(/', $substr, $m)) {
47 47
                     $needle += strlen($m[0]);
48
-                    $ret[]= new Token(Token::EXPR_START, $m[0]);
48
+                    $ret[] = new Token(Token::EXPR_START, $m[0]);
49 49
 
50 50
                     // record expression depth, to make sure the usage of parentheses inside the expression doesn't
51 51
                     // break tokenization (e.g. '$( ("foo") )'
52
-                    $depth ++;
52
+                    $depth++;
53 53
                 } else {
54 54
                     // store the current token in a temp var for appending, in case it's a DATA token
55 55
                     $token = end($ret);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                         $token->value .= $value;
70 70
                         unset($token);
71 71
                     } else {
72
-                        $ret[]= new Token(Token::DATA, $value);
72
+                        $ret[] = new Token(Token::DATA, $value);
73 73
                     }
74 74
                 }
75 75
             } else {
Please login to merge, or discard this patch.
src/Zicht/Tool/Script/Node/Branch.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,6 +38,6 @@
 block discarded – undo
38 38
      */
39 39
     public function append(Node $node)
40 40
     {
41
-        $this->nodes[]= $node;
41
+        $this->nodes[] = $node;
42 42
     }
43 43
 }
Please login to merge, or discard this patch.
src/Zicht/Tool/Script/Node/Task/SetNode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     public function __construct($name, $expr)
27 27
     {
28 28
         parent::__construct();
29
-        $this->nodes[0]= $expr;
29
+        $this->nodes[0] = $expr;
30 30
         $this->name = $name;
31 31
     }
32 32
 
Please login to merge, or discard this patch.
src/Zicht/Tool/Script/Node/Expr/Call.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
     public function __construct($function)
25 25
     {
26 26
         parent::__construct();
27
-        $this->nodes[]= $function;
27
+        $this->nodes[] = $function;
28 28
     }
29 29
 
30 30
     /**
Please login to merge, or discard this patch.
src/Zicht/Tool/Script/Node/Script.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         $annotations = array();
28 28
         $nodes = $this->nodes;
29 29
         while (current($nodes) instanceof Script\Annotation) {
30
-            $annotations[]= array_shift($nodes);
30
+            $annotations[] = array_shift($nodes);
31 31
         }
32 32
 
33 33
         foreach ($annotations as $annotation) {
Please login to merge, or discard this patch.
src/Zicht/Tool/Script/TokenStream.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     public function __construct($tokenList, $skipWhitespace = true)
23 23
     {
24 24
         if ($skipWhitespace) {
25
-            $callback = function (Token $token) {
25
+            $callback = function(Token $token) {
26 26
                 return !$token->match(Token::WHITESPACE);
27 27
             };
28 28
             $this->tokenList = array_values(array_filter($tokenList, $callback));
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function next()
41 41
     {
42
-        $this->ptr ++;
42
+        $this->ptr++;
43 43
     }
44 44
 
45 45
     /**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function hasNext()
51 51
     {
52
-        return $this->ptr < count($this->tokenList) -1;
52
+        return $this->ptr < count($this->tokenList)-1;
53 53
     }
54 54
 
55 55
 
Please login to merge, or discard this patch.
src/Zicht/Tool/Script/Parser/Expression.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public static $INFIX_BINARY = array(
35 35
         '==', '!=', '<=', '>=', '<', '>', '&&', '||', '=~',
36
-        '+', '*', '/',  '-'
36
+        '+', '*', '/', '-'
37 37
     );
38 38
 
39 39
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                         $ret->append($this->parse($stream));
122 122
                     }
123 123
 
124
-                    switch($type->value) {
124
+                    switch ($type->value) {
125 125
                         case '[':
126 126
                             $stream->expect(Token::OPERATOR, ']');
127 127
                             break;
Please login to merge, or discard this patch.
src/Zicht/Tool/Script/Tokenizer/Expression.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 
31 31
             if (preg_match('/^(==|=~|<=?|>=?|!=?|\?|:|\|\||&&|xor\b|or\b|and\b|\.|\[|\]|\(|\)|\+|-|\/|\*)/', $substr, $m)) {
32 32
                 if ($m[0] == ')') {
33
-                    $depth --;
33
+                    $depth--;
34 34
                     if ($depth == 0) {
35 35
                         $ret[] = new Token(Token::EXPR_END, ')');
36
-                        $needle ++;
36
+                        $needle++;
37 37
                         break;
38 38
                     }
39 39
                 } elseif ($m[0] === '(') {
40
-                    $depth ++;
40
+                    $depth++;
41 41
                 }
42
-                $ret[]= new Token(Token::OPERATOR, $m[0]);
42
+                $ret[] = new Token(Token::OPERATOR, $m[0]);
43 43
                 $needle += strlen($m[0]);
44 44
             } elseif (preg_match('/^(true|false|in|as|null)\b/', $substr, $m)) {
45 45
                 $ret[] = new Token(Token::KEYWORD, $m[0]);
@@ -48,19 +48,19 @@  discard block
 block discarded – undo
48 48
                 $ret[] = new Token(Token::IDENTIFIER, $m[0]);
49 49
                 $needle += strlen($m[0]);
50 50
             } elseif (preg_match('/^\s+/', $substr, $m)) {
51
-                $ret[]= new Token(Token::WHITESPACE, $m[0]);
51
+                $ret[] = new Token(Token::WHITESPACE, $m[0]);
52 52
                 $needle += strlen($m[0]);
53 53
             } elseif (preg_match('/^([0-9]*.)?[0-9]+/', $substr, $m)) {
54
-                $ret[]= new Token(Token::NUMBER, $m[0]);
54
+                $ret[] = new Token(Token::NUMBER, $m[0]);
55 55
                 $needle += strlen($m[0]);
56 56
             } elseif (preg_match('/^[\?,]/', $substr, $m)) {
57 57
                 $ret[] = new Token($m[0]);
58
-                $needle ++;
58
+                $needle++;
59 59
             } elseif ($string{$needle} == '"') {
60 60
                 $strData = '';
61 61
 
62 62
                 $escape = false;
63
-                for ($j = $needle +1; $j < $len; $j ++) {
63
+                for ($j = $needle+1; $j < $len; $j++) {
64 64
                     $ch = $string{$j};
65 65
 
66 66
                     if ($ch == '\\') {
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                         if ($escape) {
70 70
                             $escape = false;
71 71
                         } else {
72
-                            $j ++;
72
+                            $j++;
73 73
                             break;
74 74
                         }
75 75
                     } else {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
                         }
92 92
                     }
93 93
                 }
94
-                $ret[]= new Token(Token::STRING, $strData);
94
+                $ret[] = new Token(Token::STRING, $strData);
95 95
                 $needle = $j;
96 96
             }
97 97
             if ($before === $needle) {
Please login to merge, or discard this patch.