@@ -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 | } |
@@ -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 | |
@@ -87,12 +87,12 @@ discard block |
||
| 87 | 87 | $output->writeln( |
| 88 | 88 | sprintf( |
| 89 | 89 | '%s%-40s %s', |
| 90 | - ($depth > 0 ? str_repeat(' ', $depth - 1) . '-> ' : ''), |
|
| 90 | + ($depth > 0 ? str_repeat(' ', $depth-1) . '-> ' : ''), |
|
| 91 | 91 | '<fg=red;options=bold>' . $e->getMessage() . '</fg=red;options=bold>', |
| 92 | - $depth == count($ancestry) -1 ? str_pad('[' . get_class($e) . ']', $maxLength + 15, ' ') : '' |
|
| 92 | + $depth == count($ancestry)-1 ? str_pad('[' . get_class($e) . ']', $maxLength+15, ' ') : '' |
|
| 93 | 93 | ) |
| 94 | 94 | ); |
| 95 | - $depth ++; |
|
| 95 | + $depth++; |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | } |
@@ -156,10 +156,10 @@ discard block |
||
| 156 | 156 | array( |
| 157 | 157 | new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), |
| 158 | 158 | |
| 159 | - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'), |
|
| 160 | - new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), |
|
| 161 | - new InputOption('--no-cache', '-c', InputOption::VALUE_NONE, 'Force recompilation of container code'), |
|
| 162 | - new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version.'), |
|
| 159 | + new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'), |
|
| 160 | + new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), |
|
| 161 | + new InputOption('--no-cache', '-c', InputOption::VALUE_NONE, 'Force recompilation of container code'), |
|
| 162 | + new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version.'), |
|
| 163 | 163 | ) |
| 164 | 164 | ); |
| 165 | 165 | } |
@@ -195,10 +195,10 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | $container->output = $output; |
| 197 | 197 | |
| 198 | - $container->set('VERBOSE', $input->hasParameterOption(array('--verbose', '-v'))); |
|
| 199 | - $container->set('FORCE', $input->hasParameterOption(array('--force', '-f'))); |
|
| 200 | - $container->set('EXPLAIN', $input->hasParameterOption(array('--explain'))); |
|
| 201 | - $container->set('DEBUG', $input->hasParameterOption(array('--debug'))); |
|
| 198 | + $container->set('VERBOSE', $input->hasParameterOption(array('--verbose', '-v'))); |
|
| 199 | + $container->set('FORCE', $input->hasParameterOption(array('--force', '-f'))); |
|
| 200 | + $container->set('EXPLAIN', $input->hasParameterOption(array('--explain'))); |
|
| 201 | + $container->set('DEBUG', $input->hasParameterOption(array('--debug'))); |
|
| 202 | 202 | |
| 203 | 203 | foreach ($container->getCommands() as $task) { |
| 204 | 204 | $this->add($task); |
@@ -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; |
@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $this->writeText('<comment>Usage:</comment>', $options); |
| 39 | 39 | $this->writeText("\n"); |
| 40 | - $this->writeText(' '.$synopsis->getSynopsis(), $options); |
|
| 40 | + $this->writeText(' ' . $synopsis->getSynopsis(), $options); |
|
| 41 | 41 | $this->writeText("\n"); |
| 42 | 42 | |
| 43 | 43 | if (count($command->getAliases()) > 0) { |
| 44 | 44 | $this->writeText("\n"); |
| 45 | - $this->writeText('<comment>Aliases:</comment> <info>'.implode(', ', $command->getAliases()).'</info>', $options); |
|
| 45 | + $this->writeText('<comment>Aliases:</comment> <info>' . implode(', ', $command->getAliases()) . '</info>', $options); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | $this->writeText("\n"); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | if ($help = $command->getProcessedHelp()) { |
| 59 | 59 | $this->writeText('<comment>Help:</comment>', $options); |
| 60 | 60 | $this->writeText("\n"); |
| 61 | - $this->writeText(' '.str_replace("\n", "\n ", $help), $options); |
|
| 61 | + $this->writeText(' ' . str_replace("\n", "\n ", $help), $options); |
|
| 62 | 62 | $this->writeText("\n"); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | foreach ($description->getNamespaces() as $namespace) { |
| 116 | 116 | if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { |
| 117 | 117 | $this->writeText("\n"); |
| 118 | - $this->writeText('<comment>'.$namespace['id'].'</comment>', $options); |
|
| 118 | + $this->writeText('<comment>' . $namespace['id'] . '</comment>', $options); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | foreach ($namespace['commands'] as $name) { |
@@ -151,6 +151,6 @@ discard block |
||
| 151 | 151 | $width = strlen($command->getName()) > $width ? strlen($command->getName()) : $width; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - return $width + 2; |
|
| 154 | + return $width+2; |
|
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | \ No newline at end of file |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | $this->setHelp(trim($help)); |
| 47 | 47 | |
| 48 | 48 | foreach ($arguments as $name => $required) { |
| 49 | - $mode = $required ? InputArgument::REQUIRED : InputArgument::OPTIONAL; |
|
| 49 | + $mode = $required ? InputArgument::REQUIRED : InputArgument::OPTIONAL; |
|
| 50 | 50 | |
| 51 | 51 | if ($multiple = ('[]' === substr($name, -2))) { |
| 52 | 52 | $name = substr($name, 0, -2); |
| 53 | - $mode |= InputArgument::IS_ARRAY; |
|
| 53 | + $mode |= InputArgument::IS_ARRAY; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $this->addArgument($name, $mode); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $this->setHelp( |
| 88 | 88 | preg_replace_callback( |
| 89 | 89 | sprintf('/\s*%s: (.*)(\n|$)/', $name), |
| 90 | - function ($m) use (&$ret) { |
|
| 90 | + function($m) use (&$ret) { |
|
| 91 | 91 | $ret = trim($m[1]); |
| 92 | 92 | return ''; |
| 93 | 93 | }, |
@@ -122,8 +122,8 @@ discard block |
||
| 122 | 122 | $ret = preg_replace_callback( |
| 123 | 123 | '/\[--(no-)?' . $name . '\]/', |
| 124 | 124 | function() use(&$i, $name) { |
| 125 | - if ($i ++ == 0) { |
|
| 126 | - return '[--[no|]-' . $name .']'; |
|
| 125 | + if ($i++ == 0) { |
|
| 126 | + return '[--[no|]-' . $name . ']'; |
|
| 127 | 127 | } |
| 128 | 128 | return ''; |
| 129 | 129 | }, |
@@ -143,10 +143,10 @@ discard block |
||
| 143 | 143 | protected function configure() |
| 144 | 144 | { |
| 145 | 145 | $this |
| 146 | - ->addOption('explain', '', InputOption::VALUE_NONE, 'Explains the commands that would be executed.') |
|
| 147 | - ->addOption('force', 'f', InputOption::VALUE_NONE, 'Force execution of otherwise skipped tasks.') |
|
| 148 | - ->addOption('plugin', '', InputOption::VALUE_REQUIRED, 'Load additional plugins on-the-fly') |
|
| 149 | - ->addOption('debug', '', InputOption::VALUE_NONE, "Set the debug flag") |
|
| 146 | + ->addOption('explain', '', InputOption::VALUE_NONE, 'Explains the commands that would be executed.') |
|
| 147 | + ->addOption('force', 'f', InputOption::VALUE_NONE, 'Force execution of otherwise skipped tasks.') |
|
| 148 | + ->addOption('plugin', '', InputOption::VALUE_REQUIRED, 'Load additional plugins on-the-fly') |
|
| 149 | + ->addOption('debug', '', InputOption::VALUE_NONE, "Set the debug flag") |
|
| 150 | 150 | ; |
| 151 | 151 | } |
| 152 | 152 | |