@@ -91,19 +91,19 @@ discard block |
||
91 | 91 | new InputOption('file', 'f', InputOption::VALUE_REQUIRED, 'Recipe file path'), |
92 | 92 | ); |
93 | 93 | |
94 | - $this['console'] = function () use ($console) { |
|
94 | + $this['console'] = function() use ($console) { |
|
95 | 95 | return $console; |
96 | 96 | }; |
97 | - $this['input'] = function () { |
|
97 | + $this['input'] = function() { |
|
98 | 98 | throw new \RuntimeException('Uninitialized "input" in Deployer container.'); |
99 | 99 | }; |
100 | - $this['output'] = function () { |
|
100 | + $this['output'] = function() { |
|
101 | 101 | throw new \RuntimeException('Uninitialized "output" in Deployer container.'); |
102 | 102 | }; |
103 | - $this['inputDefinition'] = function () { |
|
103 | + $this['inputDefinition'] = function() { |
|
104 | 104 | return new InputDefinition(); |
105 | 105 | }; |
106 | - $this['questionHelper'] = function () { |
|
106 | + $this['questionHelper'] = function() { |
|
107 | 107 | return $this->getHelper('question'); |
108 | 108 | }; |
109 | 109 | |
@@ -111,12 +111,12 @@ discard block |
||
111 | 111 | * Config * |
112 | 112 | ******************************/ |
113 | 113 | |
114 | - $this['config'] = function () { |
|
114 | + $this['config'] = function() { |
|
115 | 115 | return new Configuration(); |
116 | 116 | }; |
117 | 117 | // -l act as if it had been invoked as a login shell (i.e. source ~/.profile file) |
118 | 118 | // -s commands are read from the standard input (no arguments should remain after this option) |
119 | - $this->config['shell'] = function () { |
|
119 | + $this->config['shell'] = function() { |
|
120 | 120 | if (currentHost() instanceof Localhost) { |
121 | 121 | return 'bash -s'; // Non-login shell for localhost. |
122 | 122 | } |
@@ -129,37 +129,37 @@ discard block |
||
129 | 129 | * Core * |
130 | 130 | ******************************/ |
131 | 131 | |
132 | - $this['pop'] = function ($c) { |
|
132 | + $this['pop'] = function($c) { |
|
133 | 133 | return new Printer($c['output']); |
134 | 134 | }; |
135 | - $this['sshClient'] = function ($c) { |
|
135 | + $this['sshClient'] = function($c) { |
|
136 | 136 | return new Client($c['output'], $c['pop'], $c['logger']); |
137 | 137 | }; |
138 | - $this['rsync'] = function ($c) { |
|
138 | + $this['rsync'] = function($c) { |
|
139 | 139 | return new Rsync($c['pop'], $c['output']); |
140 | 140 | }; |
141 | - $this['processRunner'] = function ($c) { |
|
141 | + $this['processRunner'] = function($c) { |
|
142 | 142 | return new ProcessRunner($c['pop'], $c['logger']); |
143 | 143 | }; |
144 | - $this['tasks'] = function () { |
|
144 | + $this['tasks'] = function() { |
|
145 | 145 | return new TaskCollection(); |
146 | 146 | }; |
147 | - $this['hosts'] = function () { |
|
147 | + $this['hosts'] = function() { |
|
148 | 148 | return new HostCollection(); |
149 | 149 | }; |
150 | - $this['scriptManager'] = function ($c) { |
|
150 | + $this['scriptManager'] = function($c) { |
|
151 | 151 | return new ScriptManager($c['tasks']); |
152 | 152 | }; |
153 | - $this['selector'] = function ($c) { |
|
153 | + $this['selector'] = function($c) { |
|
154 | 154 | return new Selector($c['hosts']); |
155 | 155 | }; |
156 | - $this['fail'] = function () { |
|
156 | + $this['fail'] = function() { |
|
157 | 157 | return new Collection(); |
158 | 158 | }; |
159 | - $this['messenger'] = function ($c) { |
|
159 | + $this['messenger'] = function($c) { |
|
160 | 160 | return new Messenger($c['input'], $c['output'], $c['logger']); |
161 | 161 | }; |
162 | - $this['master'] = function ($c) { |
|
162 | + $this['master'] = function($c) { |
|
163 | 163 | return new Master( |
164 | 164 | $c['hosts'], |
165 | 165 | $c['input'], |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $c['messenger'], |
168 | 168 | ); |
169 | 169 | }; |
170 | - $this['importer'] = function () { |
|
170 | + $this['importer'] = function() { |
|
171 | 171 | return new Importer(); |
172 | 172 | }; |
173 | 173 | |
@@ -175,12 +175,12 @@ discard block |
||
175 | 175 | * Logger * |
176 | 176 | ******************************/ |
177 | 177 | |
178 | - $this['log_handler'] = function () { |
|
178 | + $this['log_handler'] = function() { |
|
179 | 179 | return !empty($this['log']) |
180 | 180 | ? new FileHandler($this['log']) |
181 | 181 | : new NullHandler(); |
182 | 182 | }; |
183 | - $this['logger'] = function () { |
|
183 | + $this['logger'] = function() { |
|
184 | 184 | return new Logger($this['log_handler']); |
185 | 185 | }; |
186 | 186 | |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | $output->writeln([ |
326 | 326 | "<fg=white;bg=red> {$class} </> <comment>in {$file} on line {$exception->getLine()}:</>", |
327 | 327 | "", |
328 | - implode("\n", array_map(function ($line) { |
|
328 | + implode("\n", array_map(function($line) { |
|
329 | 329 | return " " . $line; |
330 | 330 | }, explode("\n", $exception->getMessage()))), |
331 | 331 | "", |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | private InputInterface $input; |
40 | 40 | private OutputInterface $output; |
41 | 41 | private Messenger $messenger; |
42 | - private string|false $phpBin; |
|
42 | + private string | false $phpBin; |
|
43 | 43 | |
44 | 44 | public function __construct( |
45 | 45 | HostCollection $hosts, |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | /** @var Process[] $processes */ |
172 | 172 | $processes = []; |
173 | 173 | |
174 | - $server->afterRun(function (int $port) use (&$processes, $hosts, $task) { |
|
174 | + $server->afterRun(function(int $port) use (&$processes, $hosts, $task) { |
|
175 | 175 | foreach ($hosts as $host) { |
176 | 176 | $processes[] = $this->createProcess($host, $task, $port); |
177 | 177 | } |
@@ -181,14 +181,14 @@ discard block |
||
181 | 181 | } |
182 | 182 | }); |
183 | 183 | |
184 | - $echoCallback = function (string $output) { |
|
184 | + $echoCallback = function(string $output) { |
|
185 | 185 | $output = preg_replace('/\n$/', '', $output); |
186 | 186 | if (strlen($output) !== 0) { |
187 | 187 | $this->output->writeln($output); |
188 | 188 | } |
189 | 189 | }; |
190 | 190 | |
191 | - $server->ticker(function () use (&$processes, $server, $echoCallback) { |
|
191 | + $server->ticker(function() use (&$processes, $server, $echoCallback) { |
|
192 | 192 | $this->gatherOutput($processes, $echoCallback); |
193 | 193 | if ($this->output->isDecorated() && !getenv('CI')) { |
194 | 194 | $this->output->write(spinner()); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | }); |
200 | 200 | |
201 | - $server->router(function (string $path, array $payload) { |
|
201 | + $server->router(function(string $path, array $payload) { |
|
202 | 202 | switch ($path) { |
203 | 203 | case '/load': |
204 | 204 | ['host' => $host] = $payload; |