From f8c1ea383ef7eca7554640abd31ed8a0bc902b3a Mon Sep 17 00:00:00 2001
From: "Theresa.Grannum" <theresa.grannum@3688861.no-reply.drupal.org>
Date: Fri, 13 May 2022 19:24:45 +0000
Subject: [PATCH] Issue #3280204 by Theresa.Grannum: Missing documentation on
 'addError' and 'add Warning'

---
 package_manager/src/Event/PreOperationStageEvent.php | 6 ++++++
 src/Event/ReadinessCheckEvent.php                    | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/package_manager/src/Event/PreOperationStageEvent.php b/package_manager/src/Event/PreOperationStageEvent.php
index 226af627bd..3af2e1a5ad 100644
--- a/package_manager/src/Event/PreOperationStageEvent.php
+++ b/package_manager/src/Event/PreOperationStageEvent.php
@@ -38,6 +38,12 @@ abstract class PreOperationStageEvent extends StageEvent {
 
   /**
    * Adds error information to the event.
+   *
+   * @param \Drupal\Core\StringTranslation\TranslatableMarkup[] $messages
+   *   The error messages.
+   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $summary
+   *   (optional) The summary of error messages. Only required if there
+   *   is more than one message.
    */
   public function addError(array $messages, ?TranslatableMarkup $summary = NULL): void {
     $this->results[] = ValidationResult::createError($messages, $summary);
diff --git a/src/Event/ReadinessCheckEvent.php b/src/Event/ReadinessCheckEvent.php
index 6304816aa5..466038a106 100644
--- a/src/Event/ReadinessCheckEvent.php
+++ b/src/Event/ReadinessCheckEvent.php
@@ -65,6 +65,12 @@ class ReadinessCheckEvent extends PreOperationStageEvent {
 
   /**
    * Adds warning information to the event.
+   *
+   * @param \Drupal\Core\StringTranslation\TranslatableMarkup[] $messages
+   *   The warning messages.
+   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $summary
+   *   (optional) The summary of warning messages. Required if there is more
+   *   than one message.
    */
   public function addWarning(array $messages, ?TranslatableMarkup $summary = NULL): void {
     $this->results[] = ValidationResult::createWarning($messages, $summary);
-- 
GitLab