From 006a5410b52199af0dc6628498e594473a0aa655 Mon Sep 17 00:00:00 2001 From: Jens True Date: Tue, 4 Jul 2023 08:19:02 +0000 Subject: [PATCH] Fewer warnings. --- Makefile | 2 +- src/CommandBackup.php | 12 ++++++------ src/CommandShow.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 16fc6f8..fe5a0dc 100644 --- a/Makefile +++ b/Makefile @@ -21,5 +21,5 @@ install-dev: test: vendor/bin/phpunit tests test-coverage: - vendor/bin/phpunit tests --testdox --coverage-filter src --coverage-html output/coverage --coverage-text + vendor/bin/phpunit tests --testdox --coverage-filter src --coverage-html output/coverage --coverage-text --path-coverage --testdox-html output/test.html \ No newline at end of file diff --git a/src/CommandBackup.php b/src/CommandBackup.php index a6bc37e..f090f35 100644 --- a/src/CommandBackup.php +++ b/src/CommandBackup.php @@ -34,7 +34,7 @@ class CommandBackup extends Command $sio->title('Start backup process'); try { - $app = new App($input->getArgument('config')); + $app = new App((string)$input->getArgument('config')); } catch (\Throwable $e) { $sio->error('Configuration error:' . $e->getMessage()); return Command::FAILURE; @@ -54,13 +54,13 @@ class CommandBackup extends Command $template = array(); $template['config'] = $conf; $template['start'] = new DateTime(); - $template['source_size'] = $rclone->getSize($conf['source']); + $template['source_size'] = $rclone->getSize((string)$conf['source']); $template['rclone_version'] = $rclone->getVersion(); - $template['destination_size_before'] = $rclone->getSize($conf['destination']); + $template['destination_size_before'] = $rclone->getSize((string)$conf['destination']); - $rclone->copy($conf['source'], $conf['destination'], $app->getConfig()['rclone']['options']); + $rclone->copy((string)$conf['source'], (string)$conf['destination'], $app->getConfig()['rclone']['options']); - $template['destination_size_after'] = $rclone->getSize($conf['destination']); + $template['destination_size_after'] = $rclone->getSize((string)$conf['destination']); $template['end'] = new DateTime(); $message = $render->render('notify', $template); @@ -68,7 +68,7 @@ class CommandBackup extends Command $message = $e->getMessage(); } - $notification->send($title, $message); + $notification->send((string)$title, $message); } $sio->success("Complete"); diff --git a/src/CommandShow.php b/src/CommandShow.php index 1848ee2..287ba19 100644 --- a/src/CommandShow.php +++ b/src/CommandShow.php @@ -30,7 +30,7 @@ class CommandShow extends Command $sio->title('List backup entities'); try { - $app = new App($input->getArgument('config')); + $app = new App((string)$input->getArgument('config')); } catch (\Throwable $e) { $sio->error('Configuration error: ' . $e->getMessage()); return Command::FAILURE;