@@ -95,7 +95,7 @@ |
||
| 95 | 95 | * |
| 96 | 96 | * @param string $type |
| 97 | 97 | * @param string $value |
| 98 | - * @return mixed |
|
| 98 | + * @return boolean |
|
| 99 | 99 | */ |
| 100 | 100 | public function match($type, $value = null) |
| 101 | 101 | { |
@@ -22,7 +22,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $ret = 'array('; |
| 30 | 30 | $i = 0; |
| 31 | 31 | foreach ($var as $key => $value) { |
| 32 | - if ($i ++ > 0) { |
|
| 32 | + if ($i++ > 0) { |
|
| 33 | 33 | $ret .= ', '; |
| 34 | 34 | } |
| 35 | 35 | if (!$skipKeys) { |
@@ -93,13 +93,13 @@ |
||
| 93 | 93 | } |
| 94 | 94 | foreach ($zfiles as $file) { |
| 95 | 95 | Debug::enterScope($file); |
| 96 | - $this->sourceFiles[]= $file; |
|
| 96 | + $this->sourceFiles[] = $file; |
|
| 97 | 97 | $this->loader->load($file); |
| 98 | 98 | Debug::exitScope($file); |
| 99 | 99 | } |
| 100 | 100 | foreach ($this->loader->getPlugins() as $name => $file) { |
| 101 | 101 | Debug::enterScope($file); |
| 102 | - $this->sourceFiles[]= $file; |
|
| 102 | + $this->sourceFiles[] = $file; |
|
| 103 | 103 | $this->loadPlugin($name, $file); |
| 104 | 104 | Debug::exitScope($file); |
| 105 | 105 | } |
@@ -145,7 +145,7 @@ |
||
| 145 | 145 | /** |
| 146 | 146 | * Returns all plugins registered while loading. |
| 147 | 147 | * |
| 148 | - * @return array |
|
| 148 | + * @return \Zicht\Tool\PluginInterface[] |
|
| 149 | 149 | */ |
| 150 | 150 | public function getPlugins() |
| 151 | 151 | { |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | ->arrayNode('do') |
| 114 | 114 | ->beforeNormalization() |
| 115 | 115 | ->ifString()->then($toArray) |
| 116 | - ->end() |
|
| 116 | + ->end() |
|
| 117 | 117 | ->performNoDeepMerging() |
| 118 | 118 | ->prototype('scalar')->end() |
| 119 | 119 | ->defaultValue(array()) |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $treeBuilder = new TreeBuilder(); |
| 41 | 41 | |
| 42 | 42 | $zConfig = $treeBuilder->root('z'); |
| 43 | - $toArray = function ($s) { |
|
| 43 | + $toArray = function($s) { |
|
| 44 | 44 | return array($s); |
| 45 | 45 | }; |
| 46 | 46 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | is_string($in) |
| 62 | 62 | |
| 63 | 63 | // allow for 'lists' (skipping the 'do' key) |
| 64 | - || (is_array($in) && range(0, count($in) -1) === array_keys($in)); |
|
| 64 | + || (is_array($in) && range(0, count($in)-1) === array_keys($in)); |
|
| 65 | 65 | } |
| 66 | 66 | ) |
| 67 | 67 | ->then( |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * @var array |
| 38 | 38 | */ |
| 39 | 39 | protected $plugins = array(); |
| 40 | - protected $pluginPaths = array(); |
|
| 40 | + protected $pluginPaths = array(); |
|
| 41 | 41 | protected $sourceFiles = array(); |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | if (!is_file($resource)) { |
| 78 | 78 | $fileContents = $resource; |
| 79 | 79 | } else { |
| 80 | - $this->sourceFiles[]= $resource; |
|
| 80 | + $this->sourceFiles[] = $resource; |
|
| 81 | 81 | $fileContents = file_get_contents($resource); |
| 82 | 82 | } |
| 83 | 83 | Debug::enterScope('annotations'); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | unset($config['imports']); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $this->configs[]= $config; |
|
| 117 | + $this->configs[] = $config; |
|
| 118 | 118 | |
| 119 | 119 | return $config; |
| 120 | 120 | } |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $this->pluginPaths[$name] = dirname($this->plugins[$name]); |
| 184 | 184 | |
| 185 | 185 | $hasPlugin = true; |
| 186 | - $this->sourceFiles[]= $this->plugins[$name]; |
|
| 186 | + $this->sourceFiles[] = $this->plugins[$name]; |
|
| 187 | 187 | } catch (\InvalidArgumentException $e) { |
| 188 | 188 | } |
| 189 | 189 | |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | $hasZfile = true; |
| 203 | - $this->sourceFiles[]= $zFileLocation; |
|
| 203 | + $this->sourceFiles[] = $zFileLocation; |
|
| 204 | 204 | } catch (\InvalidArgumentException $e) { |
| 205 | 205 | } |
| 206 | 206 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public static function getScope() |
| 21 | 21 | { |
| 22 | - return self::$scope[count(self::$scope) -1]; |
|
| 22 | + return self::$scope[count(self::$scope)-1]; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | throw new \InvalidArgumentException("Only scalars allowed as scope identifiers"); |
| 35 | 35 | } |
| 36 | 36 | array_push(self::$scope, $scope); |
| 37 | - list($call)= debug_backtrace(0); |
|
| 37 | + list($call) = debug_backtrace(0); |
|
| 38 | 38 | array_push(self::$scopeChange, $call); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -24,12 +24,12 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | public static function getByPath($subject, array $path, $notFoundIsError = true) |
| 26 | 26 | { |
| 27 | - $ptr =& $subject; |
|
| 27 | + $ptr = & $subject; |
|
| 28 | 28 | foreach ($path as $key) { |
| 29 | 29 | if (is_object($ptr) && property_exists($ptr, $key)) { |
| 30 | - $ptr =& $ptr->$key; |
|
| 30 | + $ptr = & $ptr->$key; |
|
| 31 | 31 | } elseif (is_array($ptr) && array_key_exists($key, $ptr)) { |
| 32 | - $ptr =& $ptr[$key]; |
|
| 32 | + $ptr = & $ptr[$key]; |
|
| 33 | 33 | } else { |
| 34 | 34 | if ($notFoundIsError === true) { |
| 35 | 35 | throw new \OutOfBoundsException("Path not found: " . implode('.', $path) . ", key {$key} did not resolve"); |
@@ -51,18 +51,18 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public static function setByPath(&$subject, array $path, $value) |
| 53 | 53 | { |
| 54 | - $ptr =& $subject; |
|
| 54 | + $ptr = & $subject; |
|
| 55 | 55 | foreach ($path as $key) { |
| 56 | 56 | if (is_object($ptr)) { |
| 57 | 57 | if (!isset($ptr->$key)) { |
| 58 | 58 | $ptr->$key = array(); |
| 59 | 59 | } |
| 60 | - $ptr =& $ptr->$key; |
|
| 60 | + $ptr = & $ptr->$key; |
|
| 61 | 61 | } elseif (is_array($ptr)) { |
| 62 | 62 | if (!isset($ptr[$key])) { |
| 63 | 63 | $ptr[$key] = array(); |
| 64 | 64 | } |
| 65 | - $ptr =& $ptr[$key]; |
|
| 65 | + $ptr = & $ptr[$key]; |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | $ptr = $value; |
@@ -32,12 +32,12 @@ |
||
| 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 | } |
@@ -45,11 +45,11 @@ discard block |
||
| 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 |
||
| 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 { |