2015-08-11 18:45:07 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2024-06-06 09:55:47 +02:00
|
|
|
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2015-08-11 18:45:07 +01:00
|
|
|
*/
|
|
|
|
namespace OCA\Files_External\Lib;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* External storage backend dependency
|
|
|
|
*/
|
|
|
|
class MissingDependency {
|
|
|
|
|
|
|
|
/** @var string|null Custom message */
|
2025-05-07 18:48:38 +02:00
|
|
|
private ?string $message = null;
|
|
|
|
private bool $optional = false;
|
2015-08-11 18:45:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $dependency
|
|
|
|
*/
|
2024-10-18 12:04:22 +02:00
|
|
|
public function __construct(
|
2025-05-07 18:48:38 +02:00
|
|
|
private readonly string $dependency,
|
2024-10-18 12:04:22 +02:00
|
|
|
) {
|
2015-08-11 18:45:07 +01:00
|
|
|
}
|
|
|
|
|
2022-10-17 11:50:32 +02:00
|
|
|
public function getDependency(): string {
|
2015-08-11 18:45:07 +01:00
|
|
|
return $this->dependency;
|
|
|
|
}
|
|
|
|
|
2022-10-17 11:50:32 +02:00
|
|
|
public function getMessage(): ?string {
|
2015-08-11 18:45:07 +01:00
|
|
|
return $this->message;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $message
|
|
|
|
* @return self
|
|
|
|
*/
|
|
|
|
public function setMessage($message) {
|
|
|
|
$this->message = $message;
|
|
|
|
return $this;
|
|
|
|
}
|
2025-05-07 18:48:38 +02:00
|
|
|
|
|
|
|
public function isOptional(): bool {
|
|
|
|
return $this->optional;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setOptional(bool $optional): void {
|
|
|
|
$this->optional = $optional;
|
|
|
|
}
|
2015-08-11 18:45:07 +01:00
|
|
|
}
|