Completed
Pull Request — master (#268)
by
unknown
04:14
created
src/Result/PrinterCli.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
         $configuration = $event->getConfiguration();
158 158
         if ($this->verbose) {
159 159
             $this->write(
160
-                'Runtime:       '.$this->runtime->getNameWithVersion().PHP_EOL.
161
-                'Configuration: '.$configuration->getFilename().PHP_EOL.
160
+                'Runtime:       ' . $this->runtime->getNameWithVersion() . PHP_EOL .
161
+                'Configuration: ' . $configuration->getFilename() . PHP_EOL .
162 162
                 PHP_EOL
163 163
             );
164 164
         }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         $this->numBackups++;
188 188
         if ($this->debug) {
189 189
             $backup = $event->getConfiguration();
190
-            $this->writeWithAsterisk('backup: ['.$backup->getSource()->type.'] ');
190
+            $this->writeWithAsterisk('backup: [' . $backup->getSource()->type . '] ');
191 191
         }
192 192
     }
193 193
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
     public function onBackupFailed(Event\Backup\Failed $event): void
210 210
     {
211 211
         if ($this->debug) {
212
-            $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL);
212
+            $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL);
213 213
         }
214 214
     }
215 215
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
         if ($this->colors) {
226 226
             $buffer = Util\Cli::formatWithColor($color, $buffer);
227 227
         }
228
-        $this->write($buffer.PHP_EOL);
228
+        $this->write($buffer . PHP_EOL);
229 229
     }
230 230
 
231 231
     /**
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
     public function onBackupEnd(Event\Backup\End $event): void
237 237
     {
238 238
         if ($this->debug) {
239
-            $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL);
239
+            $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL);
240 240
         }
241 241
     }
242 242
 
@@ -250,8 +250,8 @@  discard block
 block discarded – undo
250 250
         $this->numChecks++;
251 251
         if ($this->debug) {
252 252
             $check = $event->getConfiguration();
253
-            $this->writeWithAsterisk('check: ['.$check->type.'] ');
254
-            $this->write('checking: ['.$check->value.'] ');
253
+            $this->writeWithAsterisk('check: [' . $check->type . '] ');
254
+            $this->write('checking: [' . $check->value . '] ');
255 255
         }
256 256
     }
257 257
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
         $this->failedChecks[] = $event;
266 266
 
267 267
         if ($this->debug) {
268
-            $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL);
268
+            $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL);
269 269
         }
270 270
     }
271 271
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
     public function onCheckEnd(Event\Check\End $event): void
278 278
     {
279 279
         if ($this->debug) {
280
-            $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL);
280
+            $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL);
281 281
         }
282 282
     }
283 283
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
         $this->numCrypts++;
292 292
         if ($this->debug) {
293 293
             $crypt = $event->getConfiguration();
294
-            $this->writeWithAsterisk('crypt: ['.$crypt->type.'] ');
294
+            $this->writeWithAsterisk('crypt: [' . $crypt->type . '] ');
295 295
         }
296 296
     }
297 297
 
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
     public function onCryptSkipped(Event\Crypt\Skipped $event): void
304 304
     {
305 305
         if ($this->debug) {
306
-            $this->writeWithColor('fg-black, bg-yellow', 'skipped'.PHP_EOL);
306
+            $this->writeWithColor('fg-black, bg-yellow', 'skipped' . PHP_EOL);
307 307
         }
308 308
     }
309 309
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
     public function onCryptFailed(Event\Crypt\Failed $event): void
316 316
     {
317 317
         if ($this->debug) {
318
-            $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL);
318
+            $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL);
319 319
         }
320 320
     }
321 321
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
     public function onCryptEnd(Event\Crypt\End $event): void
328 328
     {
329 329
         if ($this->debug) {
330
-            $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL);
330
+            $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL);
331 331
         }
332 332
     }
333 333
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
         $this->numSyncs++;
342 342
         if ($this->debug) {
343 343
             $sync = $event->getConfiguration();
344
-            $this->writeWithAsterisk('sync: ['.$sync->type.'] ');
344
+            $this->writeWithAsterisk('sync: [' . $sync->type . '] ');
345 345
         }
346 346
     }
347 347
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     public function onSyncSkipped(Event\Sync\Skipped $event): void
354 354
     {
355 355
         if ($this->debug) {
356
-            $this->writeWithColor('fg-black, bg-yellow', 'skipped'.PHP_EOL);
356
+            $this->writeWithColor('fg-black, bg-yellow', 'skipped' . PHP_EOL);
357 357
         }
358 358
     }
359 359
 
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
     public function onSyncFailed(Event\Sync\Failed $event): void
366 366
     {
367 367
         if ($this->debug) {
368
-            $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL);
368
+            $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL);
369 369
         }
370 370
     }
371 371
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
     public function onSyncEnd(Event\Sync\End $event): void
378 378
     {
379 379
         if ($this->debug) {
380
-            $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL);
380
+            $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL);
381 381
         }
382 382
     }
383 383
 
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
         $this->numCleanups++;
392 392
         if ($this->debug) {
393 393
             $cleanup = $event->getConfiguration();
394
-            $this->writeWithAsterisk('cleanup: ['.$cleanup->type.'] ');
394
+            $this->writeWithAsterisk('cleanup: [' . $cleanup->type . '] ');
395 395
         }
396 396
     }
397 397
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
     public function onCleanupSkipped(Event\Cleanup\Skipped $event): void
404 404
     {
405 405
         if ($this->debug) {
406
-            $this->writeWithColor('fg-black, bg-yellow', 'skipped'.PHP_EOL);
406
+            $this->writeWithColor('fg-black, bg-yellow', 'skipped' . PHP_EOL);
407 407
         }
408 408
     }
409 409
 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
     public function onCleanupFailed(Event\Cleanup\Failed $event): void
416 416
     {
417 417
         if ($this->debug) {
418
-            $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL);
418
+            $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL);
419 419
         }
420 420
     }
421 421
 
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
     public function onCleanupEnd(Event\Cleanup\End $event): void
428 428
     {
429 429
         if ($this->debug) {
430
-            $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL);
430
+            $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL);
431 431
         }
432 432
     }
433 433
 
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
     public function onDebug(Event\Debug $event): void
440 440
     {
441 441
         if ($this->debug) {
442
-            $this->write($event->getMessage().PHP_EOL);
442
+            $this->write($event->getMessage() . PHP_EOL);
443 443
         }
444 444
     }
445 445
 
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
      */
451 451
     public function onWarning(Event\Warning $event): void
452 452
     {
453
-        $this->writeWithColor('fg-black, bg-yellow', $event->getMessage().PHP_EOL);
453
+        $this->writeWithColor('fg-black, bg-yellow', $event->getMessage() . PHP_EOL);
454 454
     }
455 455
 
456 456
     /**
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
      */
489 489
     protected function printHeader(): void
490 490
     {
491
-        $this->write(Statistics::resourceUsage().PHP_EOL.PHP_EOL);
491
+        $this->write(Statistics::resourceUsage() . PHP_EOL . PHP_EOL);
492 492
     }
493 493
 
494 494
     /**
@@ -568,13 +568,13 @@  discard block
 block discarded – undo
568 568
         $clSkipped = str_pad($backup->cleanupCountSkipped(), 7, ' ', STR_PAD_LEFT);
569 569
         $clFailed = str_pad($backup->cleanupCountFailed(), 6, ' ', STR_PAD_LEFT);
570 570
 
571
-        $out = PHP_EOL.'          | executed | skipped | failed |'.PHP_EOL
572
-            .'----------+----------+---------+--------+'.PHP_EOL
573
-            .' checks   | '.$chExecuted.' |         | '.$chFailed.' |'.PHP_EOL
574
-            .' crypts   | '.$crExecuted.' | '.$crSkipped.' | '.$crFailed.' |'.PHP_EOL
575
-            .' syncs    | '.$syExecuted.' | '.$sySkipped.' | '.$syFailed.' |'.PHP_EOL
576
-            .' cleanups | '.$clExecuted.' | '.$clSkipped.' | '.$clFailed.' |'.PHP_EOL
577
-            .'----------+----------+---------+--------+'.PHP_EOL.PHP_EOL;
571
+        $out = PHP_EOL . '          | executed | skipped | failed |' . PHP_EOL
572
+            .'----------+----------+---------+--------+' . PHP_EOL
573
+            .' checks   | ' . $chExecuted . ' |         | ' . $chFailed . ' |' . PHP_EOL
574
+            .' crypts   | ' . $crExecuted . ' | ' . $crSkipped . ' | ' . $crFailed . ' |' . PHP_EOL
575
+            .' syncs    | ' . $syExecuted . ' | ' . $sySkipped . ' | ' . $syFailed . ' |' . PHP_EOL
576
+            .' cleanups | ' . $clExecuted . ' | ' . $clSkipped . ' | ' . $clFailed . ' |' . PHP_EOL
577
+            .'----------+----------+---------+--------+' . PHP_EOL . PHP_EOL;
578 578
 
579 579
         $this->write($out);
580 580
     }
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
             $this->writeWithColor(
596 596
                 'fg-green',
597 597
                 sprintf(
598
-                    'OK (%d %s, %d %s, %d %s, %d %s, %d %s)'.PHP_EOL,
598
+                    'OK (%d %s, %d %s, %d %s, %d %s, %d %s)' . PHP_EOL,
599 599
                     count($result->getBackups()),
600 600
                     Util\Str::appendPluralS('backup', count($result->getBackups())),
601 601
                     $this->numChecks,
@@ -612,8 +612,8 @@  discard block
 block discarded – undo
612 612
             $this->writeWithColor(
613 613
                 'fg-yellow',
614 614
                 sprintf(
615
-                    "WARNING, skipped|failed Crypts, Syncs or Cleanups!".PHP_EOL.
616
-                    'Backups: %d, Crypts: %d|%d, Syncs: %d|%d, Cleanups: %d|%d '.PHP_EOL,
615
+                    "WARNING, skipped|failed Crypts, Syncs or Cleanups!" . PHP_EOL .
616
+                    'Backups: %d, Crypts: %d|%d, Syncs: %d|%d, Cleanups: %d|%d ' . PHP_EOL,
617 617
                     count($result->getBackups()),
618 618
                     $result->cryptsSkippedCount(),
619 619
                     $result->cryptsFailedCount(),
@@ -627,12 +627,12 @@  discard block
 block discarded – undo
627 627
             $this->writeWithColor(
628 628
                 'fg-red',
629 629
                 sprintf(
630
-                    "FAILURE!".PHP_EOL.
630
+                    "FAILURE!" . PHP_EOL .
631 631
                     'Backups: %d, '
632 632
                     .'failed Checks: %d, '
633 633
                     .'failed Crypts: %d, '
634 634
                     .'failed Syncs: %d, '
635
-                    .'failed Cleanups: %d.'.PHP_EOL,
635
+                    .'failed Cleanups: %d.' . PHP_EOL,
636 636
                     count($result->getBackups()),
637 637
                     $result->checksFailedCount(),
638 638
                     $result->cryptsFailedCount(),
Please login to merge, or discard this patch.