Completed
Push — master ( 9909f5...eccc70 )
by Sebastian
02:46
created
src/Result/PrinterCli.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
     public function onPhpbuStart(Event\App\Start $event)
171 171
     {
172 172
         $configuration = $event->getConfiguration();
173
-        $this->write(Version::getVersionString() . ' by Sebastian Feldmann and contributors.' . PHP_EOL . PHP_EOL);
173
+        $this->write(Version::getVersionString().' by Sebastian Feldmann and contributors.'.PHP_EOL.PHP_EOL);
174 174
         if ($this->verbose) {
175 175
             $this->write(
176
-                'Runtime:       ' . $this->runtime->getNameWithVersion() . PHP_EOL .
177
-                'Configuration: ' . $configuration->getFilename() . PHP_EOL .
176
+                'Runtime:       '.$this->runtime->getNameWithVersion().PHP_EOL.
177
+                'Configuration: '.$configuration->getFilename().PHP_EOL.
178 178
                 PHP_EOL
179 179
             );
180 180
         }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         $this->numBackups++;
191 191
         if ($this->debug) {
192 192
             $backup = $event->getConfiguration();
193
-            $this->writeWithAsterisk('backup: [' . $backup->getSource()->type . '] ');
193
+            $this->writeWithAsterisk('backup: ['.$backup->getSource()->type.'] ');
194 194
         }
195 195
     }
196 196
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     public function onBackupFailed(Event\Backup\Failed $event)
203 203
     {
204 204
         if ($this->debug) {
205
-            $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL);
205
+            $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL);
206 206
         }
207 207
     }
208 208
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     public function onBackupEnd(Event\Backup\End $event)
215 215
     {
216 216
         if ($this->debug) {
217
-            $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL);
217
+            $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL);
218 218
         }
219 219
     }
220 220
 
@@ -228,8 +228,8 @@  discard block
 block discarded – undo
228 228
         $this->numChecks++;
229 229
         if ($this->debug) {
230 230
             $check = $event->getConfiguration();
231
-            $this->writeWithAsterisk('check: [' . $check->type . '] ');
232
-            $this->write('checking: [' . $check->value . '] ');
231
+            $this->writeWithAsterisk('check: ['.$check->type.'] ');
232
+            $this->write('checking: ['.$check->value.'] ');
233 233
         }
234 234
     }
235 235
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
     public function onCheckFailed(Event\Check\Failed $event)
242 242
     {
243 243
         if ($this->debug) {
244
-            $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL);
244
+            $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL);
245 245
         }
246 246
     }
247 247
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     public function onCheckEnd(Event\Check\End $event)
254 254
     {
255 255
         if ($this->debug) {
256
-            $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL);
256
+            $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL);
257 257
         }
258 258
     }
259 259
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
         $this->numCrypts++;
268 268
         if ($this->debug) {
269 269
             $crypt = $event->getConfiguration();
270
-            $this->writeWithAsterisk('crypt: [' . $crypt->type . '] ');
270
+            $this->writeWithAsterisk('crypt: ['.$crypt->type.'] ');
271 271
         }
272 272
     }
273 273
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
     public function onCryptSkipped(Event\Crypt\Skipped $event)
280 280
     {
281 281
         if ($this->debug) {
282
-            $this->writeWithColor('fg-black, bg-yellow', 'skipped' . PHP_EOL);
282
+            $this->writeWithColor('fg-black, bg-yellow', 'skipped'.PHP_EOL);
283 283
         }
284 284
     }
285 285
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
     public function onCryptFailed(Event\Crypt\Failed $event)
292 292
     {
293 293
         if ($this->debug) {
294
-            $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL);
294
+            $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL);
295 295
         }
296 296
     }
297 297
 
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
     public function onCryptEnd(Event\Crypt\End $event)
304 304
     {
305 305
         if ($this->debug) {
306
-            $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL);
306
+            $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL);
307 307
         }
308 308
     }
309 309
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
         $this->numSyncs++;
318 318
         if ($this->debug) {
319 319
             $sync = $event->getConfiguration();
320
-            $this->writeWithAsterisk('sync: [' . $sync->type . '] ');
320
+            $this->writeWithAsterisk('sync: ['.$sync->type.'] ');
321 321
         }
322 322
     }
323 323
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
     public function onSyncSkipped(Event\Sync\Skipped $event)
330 330
     {
331 331
         if ($this->debug) {
332
-            $this->writeWithColor('fg-black, bg-yellow', 'skipped' . PHP_EOL);
332
+            $this->writeWithColor('fg-black, bg-yellow', 'skipped'.PHP_EOL);
333 333
         }
334 334
     }
335 335
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
     public function onSyncFailed(Event\Sync\Failed $event)
342 342
     {
343 343
         if ($this->debug) {
344
-            $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL);
344
+            $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL);
345 345
         }
346 346
     }
347 347
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     public function onSyncEnd(Event\Sync\End $event)
354 354
     {
355 355
         if ($this->debug) {
356
-            $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL);
356
+            $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL);
357 357
         }
358 358
     }
359 359
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         $this->numCleanups++;
368 368
         if ($this->debug) {
369 369
             $cleanup = $event->getConfiguration();
370
-            $this->writeWithAsterisk('cleanup: [' . $cleanup->type . '] ');
370
+            $this->writeWithAsterisk('cleanup: ['.$cleanup->type.'] ');
371 371
         }
372 372
     }
373 373
 
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
     public function onCleanupSkipped(Event\Cleanup\Skipped $event)
380 380
     {
381 381
         if ($this->debug) {
382
-            $this->writeWithColor('fg-black, bg-yellow', 'skipped' . PHP_EOL);
382
+            $this->writeWithColor('fg-black, bg-yellow', 'skipped'.PHP_EOL);
383 383
         }
384 384
     }
385 385
 
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     public function onCleanupFailed(Event\Cleanup\Failed $event)
392 392
     {
393 393
         if ($this->debug) {
394
-            $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL);
394
+            $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL);
395 395
         }
396 396
     }
397 397
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
     public function onCleanupEnd(Event\Cleanup\End $event)
404 404
     {
405 405
         if ($this->debug) {
406
-            $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL);
406
+            $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL);
407 407
         }
408 408
     }
409 409
 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
     public function onDebug(Event\Debug $event)
416 416
     {
417 417
         if ($this->debug) {
418
-            $this->write($event->getMessage() . PHP_EOL);
418
+            $this->write($event->getMessage().PHP_EOL);
419 419
         }
420 420
     }
421 421
 
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
      */
454 454
     protected function printHeader()
455 455
     {
456
-        $this->write(PHP_Timer::resourceUsage() . PHP_EOL . PHP_EOL);
456
+        $this->write(PHP_Timer::resourceUsage().PHP_EOL.PHP_EOL);
457 457
     }
458 458
 
459 459
     /**
@@ -513,13 +513,13 @@  discard block
 block discarded – undo
513 513
         $clSkipped  = str_pad($backup->cleanupCountSkipped(), 7, ' ', STR_PAD_LEFT);
514 514
         $clFailed   = str_pad($backup->cleanupCountFailed(), 6, ' ', STR_PAD_LEFT);
515 515
 
516
-        $out = PHP_EOL . '          | executed | skipped | failed |' . PHP_EOL
517
-            . '----------+----------+---------+--------+' . PHP_EOL
518
-            . ' checks   | ' . $chExecuted . ' |         | ' . $chFailed . ' |' . PHP_EOL
519
-            . ' crypts   | ' . $crExecuted . ' | ' . $crSkipped . ' | ' . $crFailed . ' |' . PHP_EOL
520
-            . ' syncs    | ' . $syExecuted . ' | ' . $sySkipped . ' | ' . $syFailed . ' |' . PHP_EOL
521
-            . ' cleanups | ' . $clExecuted . ' | ' . $clSkipped . ' | ' . $clFailed . ' |' . PHP_EOL
522
-            . '----------+----------+---------+--------+' . PHP_EOL . PHP_EOL;
516
+        $out = PHP_EOL.'          | executed | skipped | failed |'.PHP_EOL
517
+            . '----------+----------+---------+--------+'.PHP_EOL
518
+            . ' checks   | '.$chExecuted.' |         | '.$chFailed.' |'.PHP_EOL
519
+            . ' crypts   | '.$crExecuted.' | '.$crSkipped.' | '.$crFailed.' |'.PHP_EOL
520
+            . ' syncs    | '.$syExecuted.' | '.$sySkipped.' | '.$syFailed.' |'.PHP_EOL
521
+            . ' cleanups | '.$clExecuted.' | '.$clSkipped.' | '.$clFailed.' |'.PHP_EOL
522
+            . '----------+----------+---------+--------+'.PHP_EOL.PHP_EOL;
523 523
 
524 524
         $this->write($out);
525 525
     }
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
             $this->writeWithColor(
541 541
                 'fg-black, bg-green',
542 542
                 sprintf(
543
-                    'OK (%d %s, %d %s, %d %s, %d %s, %d %s)' . PHP_EOL,
543
+                    'OK (%d %s, %d %s, %d %s, %d %s, %d %s)'.PHP_EOL,
544 544
                     count($result->getBackups()),
545 545
                     Util\Str::appendPluralS('backup', count($result->getBackups())),
546 546
                     $this->numChecks,
@@ -557,8 +557,8 @@  discard block
 block discarded – undo
557 557
             $this->writeWithColor(
558 558
                 'fg-black, bg-yellow',
559 559
                 sprintf(
560
-                    "WARNING, skipped|failed Crypts, Syncs or Cleanups!" . PHP_EOL .
561
-                    'Backups: %d, Crypts: %d|%d, Syncs: %d|%d, Cleanups: %d|%d ' . PHP_EOL,
560
+                    "WARNING, skipped|failed Crypts, Syncs or Cleanups!".PHP_EOL.
561
+                    'Backups: %d, Crypts: %d|%d, Syncs: %d|%d, Cleanups: %d|%d '.PHP_EOL,
562 562
                     count($result->getBackups()),
563 563
                     $result->cryptsSkippedCount(),
564 564
                     $result->cryptsFailedCount(),
@@ -572,8 +572,8 @@  discard block
 block discarded – undo
572 572
             $this->writeWithColor(
573 573
                 'fg-white, bg-red',
574 574
                 sprintf(
575
-                    "FAILURE!" . PHP_EOL .
576
-                    'Backups: %d, failed Checks: %d, failed Crypts: %d, failed Syncs: %d, failed Cleanups: %d.' . PHP_EOL,
575
+                    "FAILURE!".PHP_EOL.
576
+                    'Backups: %d, failed Checks: %d, failed Crypts: %d, failed Syncs: %d, failed Cleanups: %d.'.PHP_EOL,
577 577
                     count($result->getBackups()),
578 578
                     $result->checksFailedCount(),
579 579
                     $result->cryptsFailedCount(),
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
         if ($this->colors) {
597 597
             $buffer = Util\Cli::formatWithColor($color, $buffer);
598 598
         }
599
-        $this->write($buffer . PHP_EOL);
599
+        $this->write($buffer.PHP_EOL);
600 600
     }
601 601
 
602 602
     /**
Please login to merge, or discard this patch.