@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $output->writeln("<info>Loading data from ${file}</info>"); |
202 | 202 | |
203 | 203 | if (!array_key_exists('target', $doc->getData())) { |
204 | - throw new MissingTargetException('Missing target in \'' . $file . '\''); |
|
204 | + throw new MissingTargetException('Missing target in \''.$file.'\''); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | $targetUrl = sprintf('%s%s', $host, $doc->getData()['target']); |
@@ -247,16 +247,16 @@ discard block |
||
247 | 247 | $content = str_replace($rewriteHost, $rewriteTo, $doc->getContent()); |
248 | 248 | $uploadFile = $this->validateUploadFile($doc, $file); |
249 | 249 | |
250 | - $successFunc = function (ResponseInterface $response) use ($output) { |
|
250 | + $successFunc = function(ResponseInterface $response) use ($output) { |
|
251 | 251 | $output->writeln( |
252 | - '<comment>Wrote ' . $response->getHeader('Link')[0] . '</comment>' |
|
252 | + '<comment>Wrote '.$response->getHeader('Link')[0].'</comment>' |
|
253 | 253 | ); |
254 | 254 | }; |
255 | 255 | |
256 | - $errFunc = function (RequestException $e) use ($output, $file) { |
|
256 | + $errFunc = function(RequestException $e) use ($output, $file) { |
|
257 | 257 | $this->errors[$file] = $e->getMessage(); |
258 | 258 | $output->writeln( |
259 | - '<error>' . str_pad( |
|
259 | + '<error>'.str_pad( |
|
260 | 260 | sprintf( |
261 | 261 | 'Failed to write <%s> from \'%s\' with message \'%s\'', |
262 | 262 | $e->getRequest()->getUri(), |
@@ -265,17 +265,17 @@ discard block |
||
265 | 265 | ), |
266 | 266 | 140, |
267 | 267 | ' ' |
268 | - ) . '</error>' |
|
268 | + ).'</error>' |
|
269 | 269 | ); |
270 | 270 | if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { |
271 | 271 | $this->dumper->dump( |
272 | 272 | $this->cloner->cloneVar( |
273 | 273 | $this->parser->parse($e->getResponse()->getBody(), false, false, true) |
274 | 274 | ), |
275 | - function ($line, $depth) use ($output) { |
|
275 | + function($line, $depth) use ($output) { |
|
276 | 276 | if ($depth > 0) { |
277 | 277 | $output->writeln( |
278 | - '<error>' . str_pad(str_repeat(' ', $depth) . $line, 140, ' ') . '</error>' |
|
278 | + '<error>'.str_pad(str_repeat(' ', $depth).$line, 140, ' ').'</error>' |
|
279 | 279 | ); |
280 | 280 | } |
281 | 281 | } |
@@ -296,11 +296,11 @@ discard block |
||
296 | 296 | // If there is a file to be uploaded, and it exists in remote, we delete it first. |
297 | 297 | $fileRepeatFunc = false; |
298 | 298 | if ($uploadFile) { |
299 | - $fileRepeatFunc = function () use ($targetUrl, $successFunc, $errFunc, $output, $file, $data) { |
|
299 | + $fileRepeatFunc = function() use ($targetUrl, $successFunc, $errFunc, $output, $file, $data) { |
|
300 | 300 | unset($this->errors[$file]); |
301 | 301 | $output->writeln('<info>File deleting: '.$targetUrl.'</info>'); |
302 | 302 | $deleteRequest = $this->client->requestAsync('DELETE', $targetUrl); |
303 | - $insert = function () use ($targetUrl, $successFunc, $errFunc, $output, $data) { |
|
303 | + $insert = function() use ($targetUrl, $successFunc, $errFunc, $output, $data) { |
|
304 | 304 | $output->writeln('<info>File inserting: '.$targetUrl.'</info>'); |
305 | 305 | $promiseInsert = $this->client->requestAsync('PUT', $targetUrl, $data); |
306 | 306 | $promiseInsert->then($successFunc, $errFunc); |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | } |
371 | 371 | |
372 | 372 | // Find file |
373 | - $fileName = dirname($originFile) . DIRECTORY_SEPARATOR . $documentData['file']; |
|
373 | + $fileName = dirname($originFile).DIRECTORY_SEPARATOR.$documentData['file']; |
|
374 | 374 | $fileName = str_replace('//', '/', $fileName); |
375 | 375 | if (!file_exists($fileName)) { |
376 | 376 | return false; |