aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-01-04 16:27:18 +0100
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>2024-01-11 14:03:55 +0100
commitf34865eb4eb2cebc6379ebb0479c2b2e997a2301 (patch)
tree95adc4c5c670f29a489e97af2040d3339b57c048 /lib
parent67fba0a574a3740976c84bb6498011e8d2cef0f1 (diff)
downloadnextcloud-server-f34865eb4eb2cebc6379ebb0479c2b2e997a2301.tar.gz
nextcloud-server-f34865eb4eb2cebc6379ebb0479c2b2e997a2301.zip
Add RichObject support for SetupChecks descriptions
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/public/SetupCheck/SetupResult.php34
1 files changed, 26 insertions, 8 deletions
diff --git a/lib/public/SetupCheck/SetupResult.php b/lib/public/SetupCheck/SetupResult.php
index e4a7744178a..51428a001e0 100644
--- a/lib/public/SetupCheck/SetupResult.php
+++ b/lib/public/SetupCheck/SetupResult.php
@@ -46,10 +46,12 @@ class SetupResult implements \JsonSerializable {
* @brief Private constructor, use success()/info()/warning()/error() instead
* @param self::SUCCESS|self::INFO|self::WARNING|self::ERROR $severity
* @since 28.0.0
+ * @since 28.0.2 Optional parameter ?array $descriptionParameters
*/
private function __construct(
private string $severity,
private ?string $description = null,
+ private ?array $descriptionParameters = null,
private ?string $linkToDoc = null,
) {
}
@@ -59,9 +61,10 @@ class SetupResult implements \JsonSerializable {
* @param ?string $description Translated detailed description to display to the user
* @param ?string $linkToDoc URI of related relevent documentation, be it from Nextcloud or another project
* @since 28.0.0
+ * @since 28.0.2 Optional parameter ?array $descriptionParameters
*/
- public static function success(?string $description = null, ?string $linkToDoc = null): self {
- return new self(self::SUCCESS, $description, $linkToDoc);
+ public static function success(?string $description = null, ?string $linkToDoc = null, ?array $descriptionParameters = null): self {
+ return new self(self::SUCCESS, $description, $descriptionParameters, $linkToDoc);
}
/**
@@ -69,9 +72,10 @@ class SetupResult implements \JsonSerializable {
* @param ?string $description Translated detailed description to display to the user
* @param ?string $linkToDoc URI of related relevent documentation, be it from Nextcloud or another project
* @since 28.0.0
+ * @since 28.0.2 Optional parameter ?array $descriptionParameters
*/
- public static function info(?string $description = null, ?string $linkToDoc = null): self {
- return new self(self::INFO, $description, $linkToDoc);
+ public static function info(?string $description = null, ?string $linkToDoc = null, ?array $descriptionParameters = null): self {
+ return new self(self::INFO, $description, $descriptionParameters, $linkToDoc);
}
/**
@@ -79,9 +83,10 @@ class SetupResult implements \JsonSerializable {
* @param ?string $description Translated detailed description to display to the user
* @param ?string $linkToDoc URI of related relevent documentation, be it from Nextcloud or another project
* @since 28.0.0
+ * @since 28.0.2 Optional parameter ?array $descriptionParameters
*/
- public static function warning(?string $description = null, ?string $linkToDoc = null): self {
- return new self(self::WARNING, $description, $linkToDoc);
+ public static function warning(?string $description = null, ?string $linkToDoc = null, ?array $descriptionParameters = null): self {
+ return new self(self::WARNING, $description, $descriptionParameters, $linkToDoc);
}
/**
@@ -89,9 +94,10 @@ class SetupResult implements \JsonSerializable {
* @param ?string $description Translated detailed description to display to the user
* @param ?string $linkToDoc URI of related relevent documentation, be it from Nextcloud or another project
* @since 28.0.0
+ * @since 28.0.2 Optional parameter ?array $descriptionParameters
*/
- public static function error(?string $description = null, ?string $linkToDoc = null): self {
- return new self(self::ERROR, $description, $linkToDoc);
+ public static function error(?string $description = null, ?string $linkToDoc = null, ?array $descriptionParameters = null): self {
+ return new self(self::ERROR, $description, $descriptionParameters, $linkToDoc);
}
/**
@@ -114,6 +120,17 @@ class SetupResult implements \JsonSerializable {
}
/**
+ * @brief Get the description parameters for the setup check result
+ *
+ * If this returns null, description must not be treated as rich text
+ *
+ * @since 28.0.2
+ */
+ public function getDescriptionParameters(): ?array {
+ return $this->descriptionParameters;
+ }
+
+ /**
* @brief Get the name for the setup check
*
* @since 28.0.0
@@ -150,6 +167,7 @@ class SetupResult implements \JsonSerializable {
'name' => $this->name,
'severity' => $this->severity,
'description' => $this->description,
+ 'descriptionParameters' => $this->descriptionParameters,
'linkToDoc' => $this->linkToDoc,
];
}