This commit is contained in:
@ -30,7 +30,6 @@ class App
|
||||
*/
|
||||
public function __construct(string $configFile)
|
||||
{
|
||||
|
||||
// Define your configuration schema
|
||||
$this->config = new Configuration([
|
||||
'rclone' => Expect::structure([
|
||||
|
@ -6,6 +6,10 @@ namespace App\Notification;
|
||||
|
||||
interface NotificationInterface
|
||||
{
|
||||
static function factory(array $config): self;
|
||||
/**
|
||||
* @param string[] $config Configuration
|
||||
*/
|
||||
public static function factory(array $config): self;
|
||||
|
||||
public function send(string $title, string $message): void;
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ use InvalidArgumentException;
|
||||
|
||||
class Ntfy implements NotificationInterface
|
||||
{
|
||||
private Client $client;
|
||||
private string $topic = 'default';
|
||||
/**
|
||||
* Initialize with configuration.
|
||||
@ -28,9 +27,8 @@ class Ntfy implements NotificationInterface
|
||||
return $instance;
|
||||
}
|
||||
|
||||
public function __construct(Client $client)
|
||||
public function __construct(private Client $client)
|
||||
{
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
public function setTopic(string $topic): void
|
||||
|
@ -18,13 +18,6 @@ use Exception;
|
||||
*/
|
||||
class Rclone
|
||||
{
|
||||
/**
|
||||
* The logger instance.
|
||||
*/
|
||||
protected LoggerInterface $logger;
|
||||
|
||||
protected string $rclonePath;
|
||||
|
||||
protected string $version = "";
|
||||
|
||||
/**
|
||||
@ -35,10 +28,9 @@ class Rclone
|
||||
*
|
||||
* @param string $rclonePath Relative or absolute path
|
||||
*/
|
||||
public function __construct(LoggerInterface $logger, string $rclonePath = "rclone")
|
||||
public function __construct(protected LoggerInterface $logger, protected string $rclonePath = "rclone")
|
||||
{
|
||||
$this->rclonePath = $rclonePath;
|
||||
$this->logger = $logger;
|
||||
|
||||
$process = $this->exec('--version');
|
||||
if (!$process->isSuccessful()) {
|
||||
|
Reference in New Issue
Block a user