Quality of life. Removing a lot of requirements etc

This commit is contained in:
2025-02-28 13:57:22 +00:00
parent e074e00c43
commit 2070c11050
13 changed files with 25 additions and 2889 deletions

View File

@ -15,7 +15,7 @@ use Nette\Schema\Expect;
/**
* Mostly working as a register pattern for the logging and configuration.
*/
class App
final class App
{
/// Logging instance
protected Logger $logger;
@ -27,7 +27,7 @@ class App
*
* @param string $configFile Relative or full path to YML config.
*
* @SuppressWarnings(PHPMD.StaticAccess)
* @SuppressWarnings("PHPMD.StaticAccess")
*/
public function __construct(string $configFile)
{

View File

@ -20,8 +20,9 @@ use DateTime;
name: 'backup',
description: 'Start backup to assigned buckets',
)]
class CommandBackup extends Command
final class CommandBackup extends Command
{
#[\Override]
protected function configure(): void
{
$this->addArgument(
@ -43,6 +44,7 @@ class CommandBackup extends Command
* 5. Send push notifications.
* 3. Report final success
*/
#[\Override]
protected function execute(InputInterface $input, OutputInterface $output): int
{
$sio = new SymfonyStyle($input, $output);

View File

@ -15,8 +15,9 @@ use Symfony\Component\Console\Style\SymfonyStyle;
name: 'show',
description: 'Show all backup entries.',
)]
class CommandShow extends Command
final class CommandShow extends Command
{
#[\Override]
protected function configure(): void
{
$this->addArgument(
@ -31,6 +32,7 @@ class CommandShow extends Command
* 2. For each configured backup print the details
* 3. Exit
*/
#[\Override]
protected function execute(InputInterface $input, OutputInterface $output): int
{
$sio = new SymfonyStyle($input, $output);

View File

@ -7,7 +7,7 @@ namespace App\Notification;
use App\Notification\Ntfy;
use Psr\Log\NullLogger;
class Notification
final class Notification
{
/**
* @var NotificationInterface[] $notifiers

View File

@ -12,7 +12,7 @@ use InvalidArgumentException;
/**
* Send a notification through a ntfy server
*/
class Ntfy implements NotificationInterface
final class Ntfy implements NotificationInterface
{
public const int TOPIC_MAX_LENGTH = 256;
public const int TITLE_MAX_LENGTH = 256;
@ -26,6 +26,7 @@ class Ntfy implements NotificationInterface
*
* @param string[] $config Configuration
*/
#[\Override]
public static function factory(array $config): self
{
$instance = new self(new Client(new Server($config['domain'])));
@ -64,6 +65,7 @@ class Ntfy implements NotificationInterface
/**
* Push a message with Ntfy
*/
#[\Override]
public function send(string $title, string $message): void
{
if (! strlen($title) || strlen($title) > self::TITLE_MAX_LENGTH) {

View File

@ -16,7 +16,7 @@ use Exception;
* Configuration of the mounts must be done before use.
* Tested using rclone v1.64.0
*/
class Rclone
final class Rclone
{
private const int MAX_RUNTIME = 4 * 3600; //4 hours maximum
protected string $version = "";

View File

@ -8,7 +8,7 @@ use Twig\Environment;
use Twig\Loader\ArrayLoader;
use App\Template\TwigExtension;
class Twig extends Environment
final class Twig extends Environment
{
/**
* @param string[] $templates Array of templates

View File

@ -13,13 +13,14 @@ use Twig\TwigFilter;
*
* Additional formatters for templates
*/
class TwigExtension extends AbstractExtension
final class TwigExtension extends AbstractExtension
{
/**
* Extend the filters
*
* @return TwigFilter[]
*/
#[\Override]
public function getFilters(): array
{
return [