diff --git a/src/CommandShow.php b/src/CommandShow.php index 2c8b290..d704d38 100644 --- a/src/CommandShow.php +++ b/src/CommandShow.php @@ -26,6 +26,11 @@ class CommandShow extends Command ); } + /** + * 1. Read the configuration file. + * 2. For each configured backup print the details + * 3. Exit + */ protected function execute(InputInterface $input, OutputInterface $output): int { $sio = new SymfonyStyle($input, $output); diff --git a/src/Notification/Notification.php b/src/Notification/Notification.php index baf95cb..b734774 100644 --- a/src/Notification/Notification.php +++ b/src/Notification/Notification.php @@ -21,7 +21,7 @@ class Notification /** * Load multiple configurations * - * @param array> $config Array of notifier configurations. + * @param array $config Array of notifier configurations. */ public function loadMany(array $config): void { diff --git a/src/Notification/Ntfy.php b/src/Notification/Ntfy.php index b97ab6e..fa3ba8e 100644 --- a/src/Notification/Ntfy.php +++ b/src/Notification/Ntfy.php @@ -13,6 +13,7 @@ use InvalidArgumentException; class Ntfy implements NotificationInterface { private string $topic = 'default'; + /** * Initialize with configuration. * @@ -45,6 +46,9 @@ class Ntfy implements NotificationInterface return $this->topic; } + /** + * Push a message with Ntfy + */ public function send(string $title, string $message): void { if (strlen($title) < 1 || strlen($title) >= 256) { diff --git a/tests/CommandBackupTest.php b/tests/CommandBackupTest.php index 4369e24..5b0d12f 100644 --- a/tests/CommandBackupTest.php +++ b/tests/CommandBackupTest.php @@ -31,7 +31,6 @@ final class CommandBackupTest extends \PHPUnit\Framework\TestCase $applicationd->add(new CommandBackup()); - $command = $applicationd->find('backup'); $commandTester = new CommandTester($command); $commandTester->execute(['config' => "bad_file"]); @@ -46,7 +45,6 @@ final class CommandBackupTest extends \PHPUnit\Framework\TestCase $applicationd->add(new CommandBackup()); - $command = $applicationd->find('backup'); $commandTester = new CommandTester($command); $this->expectException(\Exception::class); @@ -60,7 +58,6 @@ final class CommandBackupTest extends \PHPUnit\Framework\TestCase $applicationd->add(new CommandBackup()); - $command = $applicationd->find('backup'); $commandTester = new CommandTester($command); $commandTester->execute(['config' => "config.example.yml"]); @@ -76,7 +73,6 @@ final class CommandBackupTest extends \PHPUnit\Framework\TestCase $applicationd->add(new CommandBackup()); - $command = $applicationd->find('backup'); $commandTester = new CommandTester($command); $commandTester->execute(['config' => "config.example.yml"]); @@ -92,7 +88,6 @@ final class CommandBackupTest extends \PHPUnit\Framework\TestCase $applicationd->add(new CommandBackup()); - $command = $applicationd->find('backup'); $commandTester = new CommandTester($command); $commandTester->execute(['config' => "config.example.yml"]); diff --git a/tests/CommandShowTest.php b/tests/CommandShowTest.php index fa53034..20cbdaf 100644 --- a/tests/CommandShowTest.php +++ b/tests/CommandShowTest.php @@ -15,12 +15,10 @@ final class CommandShowTest extends \PHPUnit\Framework\TestCase { public function testInvalidConfig(): void { - $applicationd = new Application('backup', "1.1.1"); $applicationd->add(new CommandShow()); - $command = $applicationd->find('show'); $commandTester = new CommandTester($command); $commandTester->execute(['config' => "bad_file"]); @@ -37,7 +35,6 @@ final class CommandShowTest extends \PHPUnit\Framework\TestCase $applicationd->add(new CommandShow()); - $command = $applicationd->find('show'); $commandTester = new CommandTester($command); $commandTester->execute(['config' => "config.example.yml"]);