Quality of life improvements all around.
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
2023-07-13 11:34:56 +00:00
parent 4645488b5d
commit 6ac9fd5575
14 changed files with 105 additions and 15 deletions

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App;
use Symfony\Component\Yaml\Yaml;
@ -11,21 +13,17 @@ use League\Config\Configuration;
use Nette\Schema\Expect;
/**
* Application class
*
* Mostly working as a register pattern for the logging and configuration.
*
* @author Jens True <jens.chr.true@gmail.com>
* @license https://opensource.org/licenses/gpl-license.php GNU Public License
* @link https://jcktrue.dk
*/
class App
{
/// Logging instance
protected Logger $logger;
/// Configuration singleton
protected Configuration $config;
/**
* Create a new instance providing a config file
* Create a new instance providing a config file.
*
* @param string $configFile Relative or full path to YML config.
* @SuppressWarnings(PHPMD.StaticAccess)

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App;
use Symfony\Component\Console\Attribute\AsCommand;
@ -28,6 +30,18 @@ class CommandBackup extends Command
);
}
/**
* Start the backup process.
*
* 1. Read the configuration file.
* 2. For each configured backup entry
* 1. Get the size of the source
* 2. Get the size of the destination
* 3. Perform the backup
* 4. Get the new size of the destination
* 5. Send push notifications.
* 3. Report final success
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$sio = new SymfonyStyle($input, $output);

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App;
use Symfony\Component\Console\Attribute\AsCommand;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Notification;
use App\Notification\Ntfy;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Notification;
interface NotificationInterface

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Notification;
use Ntfy\Server;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Rclone;
use Psr\Log\LoggerAwareTrait;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Template;
use Twig\Environment;

View File

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Template;
use Symfony\Component\DependencyInjection\ContainerInterface;