@@ -64,7 +64,7 @@ |
||
| 64 | 64 | $progressBar->setEmptyBarCharacter('-'); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $callback = function ($type, $buffer) use ($host, $progressBar) { |
|
| 67 | + $callback = function($type, $buffer) use ($host, $progressBar) { |
|
| 68 | 68 | if ($progressBar) { |
| 69 | 69 | foreach (explode("\n", $buffer) as $line) { |
| 70 | 70 | if (preg_match('/(to-chk|to-check)=(\d+?)\/(\d+)/', $line, $match)) { |
@@ -231,7 +231,7 @@ |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | if (getenv('COLORTERM') === 'truecolor') { |
| 234 | - $hsv = function ($h, $s, $v) { |
|
| 234 | + $hsv = function($h, $s, $v) { |
|
| 235 | 235 | $r = $g = $b = $i = $f = $p = $q = $t = 0; |
| 236 | 236 | $i = floor($h * 6); |
| 237 | 237 | $f = $h * 6 - $i; |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | public function callback(Host $host) |
| 33 | 33 | { |
| 34 | - return function ($type, $buffer) use ($host) { |
|
| 34 | + return function($type, $buffer) use ($host) { |
|
| 35 | 35 | $this->printBuffer($type, $host, $buffer); |
| 36 | 36 | }; |
| 37 | 37 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | function array_flatten(array $array) |
| 17 | 17 | { |
| 18 | 18 | $flatten = []; |
| 19 | - array_walk_recursive($array, function ($value) use (&$flatten) { |
|
| 19 | + array_walk_recursive($array, function($value) use (&$flatten) { |
|
| 20 | 20 | $flatten[] = $value; |
| 21 | 21 | }); |
| 22 | 22 | return $flatten; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | function array_to_string(array $array): string |
| 100 | 100 | { |
| 101 | 101 | return implode(' ', array_map( |
| 102 | - function ($key, $value) { |
|
| 102 | + function($key, $value) { |
|
| 103 | 103 | return sprintf("%s='%s'", $key, $value); |
| 104 | 104 | }, |
| 105 | 105 | array_keys($array), |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | krsort($this->references, SORT_NUMERIC); |
| 32 | 32 | |
| 33 | - $references = join("\n", array_map(function ($link, $ref) { |
|
| 33 | + $references = join("\n", array_map(function($link, $ref) { |
|
| 34 | 34 | return "[#$ref]: $link"; |
| 35 | 35 | }, $this->references, array_keys($this->references))); |
| 36 | 36 | |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | public function __toString() |
| 43 | 43 | { |
| 44 | - $f = function (Item $item) { |
|
| 44 | + $f = function(Item $item) { |
|
| 45 | 45 | return "- $item"; |
| 46 | 46 | }; |
| 47 | 47 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | { |
| 22 | 22 | sort($this->references, SORT_NUMERIC); |
| 23 | 23 | |
| 24 | - $references = implode('', array_map(function ($ref) { |
|
| 24 | + $references = implode('', array_map(function($ref) { |
|
| 25 | 25 | return " [#$ref]"; |
| 26 | 26 | }, $this->references)); |
| 27 | 27 | |
@@ -90,19 +90,19 @@ discard block |
||
| 90 | 90 | new InputOption('--file', '-f', InputOption::VALUE_OPTIONAL, 'Specify Deployer file') |
| 91 | 91 | ); |
| 92 | 92 | |
| 93 | - $this['console'] = function () use ($console) { |
|
| 93 | + $this['console'] = function() use ($console) { |
|
| 94 | 94 | return $console; |
| 95 | 95 | }; |
| 96 | - $this['input'] = function () { |
|
| 96 | + $this['input'] = function() { |
|
| 97 | 97 | throw new \RuntimeException('Uninitialized "input" in Deployer container.'); |
| 98 | 98 | }; |
| 99 | - $this['output'] = function () { |
|
| 99 | + $this['output'] = function() { |
|
| 100 | 100 | throw new \RuntimeException('Uninitialized "output" in Deployer container.'); |
| 101 | 101 | }; |
| 102 | - $this['inputDefinition'] = function () { |
|
| 102 | + $this['inputDefinition'] = function() { |
|
| 103 | 103 | return new InputDefinition(); |
| 104 | 104 | }; |
| 105 | - $this['questionHelper'] = function () { |
|
| 105 | + $this['questionHelper'] = function() { |
|
| 106 | 106 | return $this->getHelper('question'); |
| 107 | 107 | }; |
| 108 | 108 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * Config * |
| 111 | 111 | ******************************/ |
| 112 | 112 | |
| 113 | - $this['config'] = function () { |
|
| 113 | + $this['config'] = function() { |
|
| 114 | 114 | return new Configuration(); |
| 115 | 115 | }; |
| 116 | 116 | $this->config['shell'] = 'bash -s'; |
@@ -125,44 +125,44 @@ discard block |
||
| 125 | 125 | * Core * |
| 126 | 126 | ******************************/ |
| 127 | 127 | |
| 128 | - $this['pop'] = function ($c) { |
|
| 128 | + $this['pop'] = function($c) { |
|
| 129 | 129 | return new Printer($c['output']); |
| 130 | 130 | }; |
| 131 | - $this['sshClient'] = function ($c) { |
|
| 131 | + $this['sshClient'] = function($c) { |
|
| 132 | 132 | return new Client($c['output'], $c['pop'], $c['logger']); |
| 133 | 133 | }; |
| 134 | - $this['rsync'] = function ($c) { |
|
| 134 | + $this['rsync'] = function($c) { |
|
| 135 | 135 | return new Rsync($c['pop'], $c['output']); |
| 136 | 136 | }; |
| 137 | - $this['processRunner'] = function ($c) { |
|
| 137 | + $this['processRunner'] = function($c) { |
|
| 138 | 138 | return new ProcessRunner($c['pop'], $c['logger']); |
| 139 | 139 | }; |
| 140 | - $this['tasks'] = function () { |
|
| 140 | + $this['tasks'] = function() { |
|
| 141 | 141 | return new TaskCollection(); |
| 142 | 142 | }; |
| 143 | - $this['hosts'] = function () { |
|
| 143 | + $this['hosts'] = function() { |
|
| 144 | 144 | return new HostCollection(); |
| 145 | 145 | }; |
| 146 | - $this['scriptManager'] = function ($c) { |
|
| 146 | + $this['scriptManager'] = function($c) { |
|
| 147 | 147 | return new ScriptManager($c['tasks']); |
| 148 | 148 | }; |
| 149 | - $this['selector'] = function ($c) { |
|
| 149 | + $this['selector'] = function($c) { |
|
| 150 | 150 | return new Selector($c['hosts']); |
| 151 | 151 | }; |
| 152 | - $this['fail'] = function () { |
|
| 152 | + $this['fail'] = function() { |
|
| 153 | 153 | return new Collection(); |
| 154 | 154 | }; |
| 155 | - $this['messenger'] = function ($c) { |
|
| 155 | + $this['messenger'] = function($c) { |
|
| 156 | 156 | return new Messenger($c['input'], $c['output']); |
| 157 | 157 | }; |
| 158 | - $this['server'] = function ($c) { |
|
| 158 | + $this['server'] = function($c) { |
|
| 159 | 159 | return new Server( |
| 160 | 160 | $c['input'], |
| 161 | 161 | $c['output'], |
| 162 | 162 | $c['questionHelper'], |
| 163 | 163 | ); |
| 164 | 164 | }; |
| 165 | - $this['master'] = function ($c) { |
|
| 165 | + $this['master'] = function($c) { |
|
| 166 | 166 | return new Master( |
| 167 | 167 | $c['input'], |
| 168 | 168 | $c['output'], |
@@ -177,12 +177,12 @@ discard block |
||
| 177 | 177 | * Logger * |
| 178 | 178 | ******************************/ |
| 179 | 179 | |
| 180 | - $this['log_handler'] = function () { |
|
| 180 | + $this['log_handler'] = function() { |
|
| 181 | 181 | return !empty($this->config['log_file']) |
| 182 | 182 | ? new FileHandler($this->config['log_file']) |
| 183 | 183 | : new NullHandler(); |
| 184 | 184 | }; |
| 185 | - $this['logger'] = function () { |
|
| 185 | + $this['logger'] = function() { |
|
| 186 | 186 | return new Logger($this['log_handler']); |
| 187 | 187 | }; |
| 188 | 188 | |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | { |
| 305 | 305 | if (is_readable($deployFile)) { |
| 306 | 306 | // Prevent variable leak into deploy.php file |
| 307 | - call_user_func(function () use ($deployFile) { |
|
| 307 | + call_user_func(function() use ($deployFile) { |
|
| 308 | 308 | // Reorder autoload stack |
| 309 | 309 | $originStack = spl_autoload_functions(); |
| 310 | 310 | |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | $output->writeln([ |
| 329 | 329 | "<fg=white;bg=red> {$class} </> <comment>in {$file} on line {$exception->getLine()}:</>", |
| 330 | 330 | "", |
| 331 | - implode("\n", array_map(function ($line) { |
|
| 331 | + implode("\n", array_map(function($line) { |
|
| 332 | 332 | return " " . $line; |
| 333 | 333 | }, explode("\n", $exception->getMessage()))), |
| 334 | 334 | "", |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | if (is_closure($rawValue)) { |
| 76 | 76 | return $this->values[$name] = $this->parse(call_user_func($rawValue)); |
| 77 | 77 | } else { |
| 78 | - return $this->values[$name]= $this->parse($rawValue); |
|
| 78 | + return $this->values[$name] = $this->parse($rawValue); |
|
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | } |