default:
foreach ($results as $category => $checks) {
$output->writeln("\t{$category}:");
- foreach ($checks as $title => $check) {
+ foreach ($checks as $check) {
$styleTag = match ($check->getSeverity()) {
'success' => 'info',
'error' => 'error',
"\t\t".
($styleTag !== null ? "<{$styleTag}>" : '').
"{$emoji} ".
- $title.
+ ($check->getName() ?? $check::class).
($description !== null ? ': '.$description : '').
($styleTag !== null ? "</{$styleTag}>" : ''),
$verbosity
}
}
foreach ($results as $category => $checks) {
- foreach ($checks as $title => $check) {
+ foreach ($checks as $check) {
if ($check->getSeverity() !== 'success') {
return self::FAILURE;
}
$setupCheckObject = Server::get($setupCheck->getService());
$this->logger->debug('Running check '.get_class($setupCheckObject));
$setupResult = $setupCheckObject->run();
+ $setupResult->setName($setupCheckObject->getName());
$category = $setupCheckObject->getCategory();
$results[$category] ??= [];
- $results[$category][$setupCheckObject->getName()] = $setupResult;
+ $results[$category][$setupCheckObject::class] = $setupResult;
}
return $results;
}
public const WARNING = 'warning';
public const ERROR = 'error';
+ /**
+ * @param string $name Translated name to display to the user
+ */
+ private ?string $name = null;
+
/**
* @brief Private constructor, use success()/info()/warning()/error() instead
* @param self::SUCCESS|self::INFO|self::WARNING|self::ERROR $severity
/**
* @brief Create a success result object
+ * @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
*/
public static function success(?string $description = null, ?string $linkToDoc = null): self {
/**
* @brief Create an info result object
+ * @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
*/
public static function info(?string $description = null, ?string $linkToDoc = null): self {
/**
* @brief Create a warning result object
+ * @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
*/
public static function warning(?string $description = null, ?string $linkToDoc = null): self {
/**
* @brief Create an error result object
+ * @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
*/
public static function error(?string $description = null, ?string $linkToDoc = null): self {
return $this->description;
}
+ /**
+ * @brief Get the name for the setup check
+ *
+ * @since 28.0.0
+ */
+ public function getName(): ?string {
+ return $this->name;
+ }
+
+ /**
+ * @brief Set the name from the setup check
+ *
+ * @since 28.0.0
+ */
+ public function setName(string $name): void {
+ $this->name = $name;
+ }
+
/**
* @brief Get a link to the doc for the explanation.
*
*/
public function jsonSerialize(): array {
return [
+ 'name' => $this->name,
'severity' => $this->severity,
'description' => $this->description,
'linkToDoc' => $this->linkToDoc,