@@ -48,7 +48,7 @@ |
||
48 | 48 | } |
49 | 49 | /** @var \Kunnu\Dropbox\Models\FileMetadata $item */ |
50 | 50 | // skip currently created backup |
51 | - if ($item->getPathDisplay() == $this->path . $this->target->getFilename()) { |
|
51 | + if ($item->getPathDisplay() == $this->path.$this->target->getFilename()) { |
|
52 | 52 | continue; |
53 | 53 | } |
54 | 54 | if ($this->isFilenameMatch($item->getName())) { |
@@ -51,7 +51,7 @@ |
||
51 | 51 | continue; |
52 | 52 | } |
53 | 53 | // skip currently created backup |
54 | - if ($object->name == $this->path . $this->target->getFilename()) { |
|
54 | + if ($object->name == $this->path.$this->target->getFilename()) { |
|
55 | 55 | continue; |
56 | 56 | } |
57 | 57 | if ($this->isFilenameMatch(basename($object->name))) { |
@@ -86,7 +86,7 @@ |
||
86 | 86 | public function sync(Target $target, Result $result) |
87 | 87 | { |
88 | 88 | // silence ftp errors |
89 | - $old = error_reporting(0); |
|
89 | + $old = error_reporting(0); |
|
90 | 90 | if (!$this->ftpConnection = ftp_connect($this->host)) { |
91 | 91 | throw new Exception( |
92 | 92 | sprintf( |
@@ -89,7 +89,7 @@ |
||
89 | 89 | public function simulateRemoteCleanup(Target $target, Result $result) |
90 | 90 | { |
91 | 91 | if ($this->cleaner) { |
92 | - $result->debug(" sync cleanup: {$this->cleanupConfig->type}" . PHP_EOL); |
|
92 | + $result->debug(" sync cleanup: {$this->cleanupConfig->type}".PHP_EOL); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | } |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | $configuration = $event->getConfiguration(); |
161 | 161 | if ($this->verbose) { |
162 | 162 | $this->write( |
163 | - 'Runtime: ' . $this->runtime->getNameWithVersion() . PHP_EOL . |
|
164 | - 'Configuration: ' . $configuration->getFilename() . PHP_EOL . |
|
163 | + 'Runtime: '.$this->runtime->getNameWithVersion().PHP_EOL. |
|
164 | + 'Configuration: '.$configuration->getFilename().PHP_EOL. |
|
165 | 165 | PHP_EOL |
166 | 166 | ); |
167 | 167 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $this->numBackups++; |
178 | 178 | if ($this->debug) { |
179 | 179 | $backup = $event->getConfiguration(); |
180 | - $this->writeWithAsterisk('backup: [' . $backup->getSource()->type . '] '); |
|
180 | + $this->writeWithAsterisk('backup: ['.$backup->getSource()->type.'] '); |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | public function onBackupFailed(Event\Backup\Failed $event) |
190 | 190 | { |
191 | 191 | if ($this->debug) { |
192 | - $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL); |
|
192 | + $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL); |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | public function onBackupEnd(Event\Backup\End $event) |
202 | 202 | { |
203 | 203 | if ($this->debug) { |
204 | - $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL); |
|
204 | + $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL); |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | |
@@ -215,8 +215,8 @@ discard block |
||
215 | 215 | $this->numChecks++; |
216 | 216 | if ($this->debug) { |
217 | 217 | $check = $event->getConfiguration(); |
218 | - $this->writeWithAsterisk('check: [' . $check->type . '] '); |
|
219 | - $this->write('checking: [' . $check->value . '] '); |
|
218 | + $this->writeWithAsterisk('check: ['.$check->type.'] '); |
|
219 | + $this->write('checking: ['.$check->value.'] '); |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | public function onCheckFailed(Event\Check\Failed $event) |
229 | 229 | { |
230 | 230 | if ($this->debug) { |
231 | - $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL); |
|
231 | + $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL); |
|
232 | 232 | } |
233 | 233 | } |
234 | 234 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | public function onCheckEnd(Event\Check\End $event) |
241 | 241 | { |
242 | 242 | if ($this->debug) { |
243 | - $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL); |
|
243 | + $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL); |
|
244 | 244 | } |
245 | 245 | } |
246 | 246 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $this->numCrypts++; |
255 | 255 | if ($this->debug) { |
256 | 256 | $crypt = $event->getConfiguration(); |
257 | - $this->writeWithAsterisk('crypt: [' . $crypt->type . '] '); |
|
257 | + $this->writeWithAsterisk('crypt: ['.$crypt->type.'] '); |
|
258 | 258 | } |
259 | 259 | } |
260 | 260 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | public function onCryptSkipped(Event\Crypt\Skipped $event) |
267 | 267 | { |
268 | 268 | if ($this->debug) { |
269 | - $this->writeWithColor('fg-black, bg-yellow', 'skipped' . PHP_EOL); |
|
269 | + $this->writeWithColor('fg-black, bg-yellow', 'skipped'.PHP_EOL); |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | public function onCryptFailed(Event\Crypt\Failed $event) |
279 | 279 | { |
280 | 280 | if ($this->debug) { |
281 | - $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL); |
|
281 | + $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL); |
|
282 | 282 | } |
283 | 283 | } |
284 | 284 | |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | public function onCryptEnd(Event\Crypt\End $event) |
291 | 291 | { |
292 | 292 | if ($this->debug) { |
293 | - $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL); |
|
293 | + $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL); |
|
294 | 294 | } |
295 | 295 | } |
296 | 296 | |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $this->numSyncs++; |
305 | 305 | if ($this->debug) { |
306 | 306 | $sync = $event->getConfiguration(); |
307 | - $this->writeWithAsterisk('sync: [' . $sync->type . '] '); |
|
307 | + $this->writeWithAsterisk('sync: ['.$sync->type.'] '); |
|
308 | 308 | } |
309 | 309 | } |
310 | 310 | |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | public function onSyncSkipped(Event\Sync\Skipped $event) |
317 | 317 | { |
318 | 318 | if ($this->debug) { |
319 | - $this->writeWithColor('fg-black, bg-yellow', 'skipped' . PHP_EOL); |
|
319 | + $this->writeWithColor('fg-black, bg-yellow', 'skipped'.PHP_EOL); |
|
320 | 320 | } |
321 | 321 | } |
322 | 322 | |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | public function onSyncFailed(Event\Sync\Failed $event) |
329 | 329 | { |
330 | 330 | if ($this->debug) { |
331 | - $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL); |
|
331 | + $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL); |
|
332 | 332 | } |
333 | 333 | } |
334 | 334 | |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | public function onSyncEnd(Event\Sync\End $event) |
341 | 341 | { |
342 | 342 | if ($this->debug) { |
343 | - $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL); |
|
343 | + $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL); |
|
344 | 344 | } |
345 | 345 | } |
346 | 346 | |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $this->numCleanups++; |
355 | 355 | if ($this->debug) { |
356 | 356 | $cleanup = $event->getConfiguration(); |
357 | - $this->writeWithAsterisk('cleanup: [' . $cleanup->type . '] '); |
|
357 | + $this->writeWithAsterisk('cleanup: ['.$cleanup->type.'] '); |
|
358 | 358 | } |
359 | 359 | } |
360 | 360 | |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | public function onCleanupSkipped(Event\Cleanup\Skipped $event) |
367 | 367 | { |
368 | 368 | if ($this->debug) { |
369 | - $this->writeWithColor('fg-black, bg-yellow', 'skipped' . PHP_EOL); |
|
369 | + $this->writeWithColor('fg-black, bg-yellow', 'skipped'.PHP_EOL); |
|
370 | 370 | } |
371 | 371 | } |
372 | 372 | |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | public function onCleanupFailed(Event\Cleanup\Failed $event) |
379 | 379 | { |
380 | 380 | if ($this->debug) { |
381 | - $this->writeWithColor('fg-white, bg-red, bold', 'failed' . PHP_EOL); |
|
381 | + $this->writeWithColor('fg-white, bg-red, bold', 'failed'.PHP_EOL); |
|
382 | 382 | } |
383 | 383 | } |
384 | 384 | |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | public function onCleanupEnd(Event\Cleanup\End $event) |
391 | 391 | { |
392 | 392 | if ($this->debug) { |
393 | - $this->writeWithColor('fg-black, bg-green', 'ok' . PHP_EOL); |
|
393 | + $this->writeWithColor('fg-black, bg-green', 'ok'.PHP_EOL); |
|
394 | 394 | } |
395 | 395 | } |
396 | 396 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | public function onDebug(Event\Debug $event) |
403 | 403 | { |
404 | 404 | if ($this->debug) { |
405 | - $this->write($event->getMessage() . PHP_EOL); |
|
405 | + $this->write($event->getMessage().PHP_EOL); |
|
406 | 406 | } |
407 | 407 | } |
408 | 408 | |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | */ |
441 | 441 | protected function printHeader() |
442 | 442 | { |
443 | - $this->write(PHP_Timer::resourceUsage() . PHP_EOL . PHP_EOL); |
|
443 | + $this->write(PHP_Timer::resourceUsage().PHP_EOL.PHP_EOL); |
|
444 | 444 | } |
445 | 445 | |
446 | 446 | /** |
@@ -500,13 +500,13 @@ discard block |
||
500 | 500 | $clSkipped = str_pad($backup->cleanupCountSkipped(), 7, ' ', STR_PAD_LEFT); |
501 | 501 | $clFailed = str_pad($backup->cleanupCountFailed(), 6, ' ', STR_PAD_LEFT); |
502 | 502 | |
503 | - $out = PHP_EOL . ' | executed | skipped | failed |' . PHP_EOL |
|
504 | - . '----------+----------+---------+--------+' . PHP_EOL |
|
505 | - . ' checks | ' . $chExecuted . ' | | ' . $chFailed . ' |' . PHP_EOL |
|
506 | - . ' crypts | ' . $crExecuted . ' | ' . $crSkipped . ' | ' . $crFailed . ' |' . PHP_EOL |
|
507 | - . ' syncs | ' . $syExecuted . ' | ' . $sySkipped . ' | ' . $syFailed . ' |' . PHP_EOL |
|
508 | - . ' cleanups | ' . $clExecuted . ' | ' . $clSkipped . ' | ' . $clFailed . ' |' . PHP_EOL |
|
509 | - . '----------+----------+---------+--------+' . PHP_EOL . PHP_EOL; |
|
503 | + $out = PHP_EOL.' | executed | skipped | failed |'.PHP_EOL |
|
504 | + . '----------+----------+---------+--------+'.PHP_EOL |
|
505 | + . ' checks | '.$chExecuted.' | | '.$chFailed.' |'.PHP_EOL |
|
506 | + . ' crypts | '.$crExecuted.' | '.$crSkipped.' | '.$crFailed.' |'.PHP_EOL |
|
507 | + . ' syncs | '.$syExecuted.' | '.$sySkipped.' | '.$syFailed.' |'.PHP_EOL |
|
508 | + . ' cleanups | '.$clExecuted.' | '.$clSkipped.' | '.$clFailed.' |'.PHP_EOL |
|
509 | + . '----------+----------+---------+--------+'.PHP_EOL.PHP_EOL; |
|
510 | 510 | |
511 | 511 | $this->write($out); |
512 | 512 | } |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | $this->writeWithColor( |
528 | 528 | 'fg-green', |
529 | 529 | sprintf( |
530 | - 'OK (%d %s, %d %s, %d %s, %d %s, %d %s)' . PHP_EOL, |
|
530 | + 'OK (%d %s, %d %s, %d %s, %d %s, %d %s)'.PHP_EOL, |
|
531 | 531 | count($result->getBackups()), |
532 | 532 | Util\Str::appendPluralS('backup', count($result->getBackups())), |
533 | 533 | $this->numChecks, |
@@ -544,8 +544,8 @@ discard block |
||
544 | 544 | $this->writeWithColor( |
545 | 545 | 'fg-yellow', |
546 | 546 | sprintf( |
547 | - "WARNING, skipped|failed Crypts, Syncs or Cleanups!" . PHP_EOL . |
|
548 | - 'Backups: %d, Crypts: %d|%d, Syncs: %d|%d, Cleanups: %d|%d ' . PHP_EOL, |
|
547 | + "WARNING, skipped|failed Crypts, Syncs or Cleanups!".PHP_EOL. |
|
548 | + 'Backups: %d, Crypts: %d|%d, Syncs: %d|%d, Cleanups: %d|%d '.PHP_EOL, |
|
549 | 549 | count($result->getBackups()), |
550 | 550 | $result->cryptsSkippedCount(), |
551 | 551 | $result->cryptsFailedCount(), |
@@ -559,12 +559,12 @@ discard block |
||
559 | 559 | $this->writeWithColor( |
560 | 560 | 'fg-red', |
561 | 561 | sprintf( |
562 | - "FAILURE!" . PHP_EOL . |
|
562 | + "FAILURE!".PHP_EOL. |
|
563 | 563 | 'Backups: %d, ' |
564 | 564 | . 'failed Checks: %d, ' |
565 | 565 | . 'failed Crypts: %d, ' |
566 | 566 | . 'failed Syncs: %d, ' |
567 | - . 'failed Cleanups: %d.' . PHP_EOL, |
|
567 | + . 'failed Cleanups: %d.'.PHP_EOL, |
|
568 | 568 | count($result->getBackups()), |
569 | 569 | $result->checksFailedCount(), |
570 | 570 | $result->cryptsFailedCount(), |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | if ($this->colors) { |
588 | 588 | $buffer = Util\Cli::formatWithColor($color, $buffer); |
589 | 589 | } |
590 | - $this->write($buffer . PHP_EOL); |
|
590 | + $this->write($buffer.PHP_EOL); |
|
591 | 591 | } |
592 | 592 | |
593 | 593 | /** |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | public static function withTrailingSlash($string) |
212 | 212 | { |
213 | - return $string . (self::hasTrailingSlash($string) ? '' : '/'); |
|
213 | + return $string.(self::hasTrailingSlash($string) ? '' : '/'); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | */ |
244 | 244 | public static function withLeadingSlash($string) |
245 | 245 | { |
246 | - return (self::hasLeadingSlash($string) ? '' : '/') . $string; |
|
246 | + return (self::hasLeadingSlash($string) ? '' : '/').$string; |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | /** |
@@ -266,6 +266,6 @@ discard block |
||
266 | 266 | */ |
267 | 267 | public static function appendPluralS($subject, $amount) |
268 | 268 | { |
269 | - return $subject . ($amount == 1 ? '' : (substr($subject, -1) == 's' ? '\'s' : 's')); |
|
269 | + return $subject.($amount == 1 ? '' : (substr($subject, -1) == 's' ? '\'s' : 's')); |
|
270 | 270 | } |
271 | 271 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $this->container = $container; |
36 | 36 | $this->filename = basename($object->name); |
37 | 37 | $this->pathname = $object->name; |
38 | - $this->size = (int)$object->contentLength; |
|
38 | + $this->size = (int) $object->contentLength; |
|
39 | 39 | $this->lastModified = $object->lastModified->getTimestamp(); |
40 | 40 | } |
41 | 41 |