@@ -26,7 +26,7 @@ |
||
| 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 | |
@@ -24,7 +24,7 @@ |
||
| 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 | /** |
@@ -27,7 +27,7 @@ |
||
| 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) { |
@@ -33,7 +33,7 @@ discard block |
||
| 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 |
||
| 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; |
@@ -30,16 +30,16 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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) { |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | public function __construct($root, array $options) |
| 26 | 26 | { |
| 27 | 27 | $this->srcRoot = $root; |
| 28 | - $this->options = $options + array( |
|
| 28 | + $this->options = $options+array( |
|
| 29 | 29 | 'config-filename' => 'z.yml', |
| 30 | 30 | 'app-name' => 'The Zicht Tool', |
| 31 | 31 | 'app-version' => 'development build (' . date('r') . ')', |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | return realpath($targetFile); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - private static $HEADER =<<<EOHEADER |
|
| 108 | + private static $HEADER = <<<EOHEADER |
|
| 109 | 109 | /** |
| 110 | 110 | * This file was built with the Z packager. For more information, |
| 111 | 111 | * visit the Z website at http://z.zicht.nl/, or contact [email protected] |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | $result = $packager->package($input->getArgument('file'), $input->getOption('force')); |
| 55 | 55 | |
| 56 | 56 | if ($output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL) { |
| 57 | - $output->writeln(sprintf("Built {$result} in %.2f seconds", microtime(true) -$t)); |
|
| 57 | + $output->writeln(sprintf("Built {$result} in %.2f seconds", microtime(true)-$t)); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $mutex = new Mutex($this->file . '.lock', true); |
| 51 | 51 | |
| 52 | 52 | $ret = $mutex->run( |
| 53 | - function () { |
|
| 53 | + function() { |
|
| 54 | 54 | if ($this->needsRecompile()) { |
| 55 | 55 | file_put_contents($this->file, $this->compileContainerCode()); |
| 56 | 56 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | - if (! ($ret instanceof Container)) { |
|
| 61 | + if (!($ret instanceof Container)) { |
|
| 62 | 62 | throw new \LogicException("The container must be returned by the compiler"); |
| 63 | 63 | } |
| 64 | 64 | foreach ($this->plugins as $plugin) { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function addPlugin(PluginInterface $p) |
| 78 | 78 | { |
| 79 | - $this->plugins[]= $p; |
|
| 79 | + $this->plugins[] = $p; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function addVisitor($callable, $condition, $when = self::BEFORE) |
| 87 | 87 | { |
| 88 | - $this->visitors[]= array($when, $condition, $callable); |
|
| 88 | + $this->visitors[] = array($when, $condition, $callable); |
|
| 89 | 89 | |
| 90 | 90 | return $this; |
| 91 | 91 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | private function doTraverse($node, $path = array()) |
| 113 | 113 | { |
| 114 | 114 | foreach ($node as $name => $value) { |
| 115 | - $path[]= $name; |
|
| 115 | + $path[] = $name; |
|
| 116 | 116 | $value = $this->doVisit($path, $value, self::BEFORE); |
| 117 | 117 | |
| 118 | 118 | if (is_array($value)) { |