From 5e7f1ca6fd75ad112d0bd9b81fc0569e49bc7864 Mon Sep 17 00:00:00 2001
From: Dave Long <dave@longwaveconsulting.com>
Date: Sun, 30 Apr 2023 17:30:24 +0100
Subject: [PATCH] Issue #3175012 by anagomes, CurriedN, andregp, ptmkenny,
 longwave, klausi, mglaman, acbramley: Update PHPDoc for DataDefinition

(cherry picked from commit 1ee262edf6027c122ad7f945676c2a49cae06e51)
---
 core/lib/Drupal/Core/TypedData/DataDefinition.php     |  4 ++--
 .../Drupal/Core/TypedData/DataDefinitionInterface.php | 11 +++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/core/lib/Drupal/Core/TypedData/DataDefinition.php b/core/lib/Drupal/Core/TypedData/DataDefinition.php
index 8ac57a164100..9653d09670a1 100644
--- a/core/lib/Drupal/Core/TypedData/DataDefinition.php
+++ b/core/lib/Drupal/Core/TypedData/DataDefinition.php
@@ -78,7 +78,7 @@ public function getLabel() {
   /**
    * Sets the human-readable label.
    *
-   * @param string $label
+   * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $label
    *   The label to set.
    *
    * @return static
@@ -99,7 +99,7 @@ public function getDescription() {
   /**
    * Sets the human-readable description.
    *
-   * @param string $description
+   * @param string|\Drupal\Core\StringTranslation\TranslatableMarkup $description
    *   The description to set.
    *
    * @return static
diff --git a/core/lib/Drupal/Core/TypedData/DataDefinitionInterface.php b/core/lib/Drupal/Core/TypedData/DataDefinitionInterface.php
index a709b7a5c523..e5614d3d462e 100644
--- a/core/lib/Drupal/Core/TypedData/DataDefinitionInterface.php
+++ b/core/lib/Drupal/Core/TypedData/DataDefinitionInterface.php
@@ -57,9 +57,10 @@ public function getDataType();
   /**
    * Returns a human readable label.
    *
-   * @return string|\Drupal\Core\StringTranslation\TranslatableMarkup
+   * @return string|\Drupal\Core\StringTranslation\TranslatableMarkup|null
    *   The label. A string or an instance of TranslatableMarkup will be returned
-   *   based on the way the label translation is handled.
+   *   based on the way the label translation is handled. NULL if no label is
+   *   available.
    */
   public function getLabel();
 
@@ -69,8 +70,10 @@ public function getLabel();
    * Descriptions are usually used on user interfaces where the data is edited
    * or displayed.
    *
-   * @return string|null
-   *   The description, or NULL if no description is available.
+   * @return string|\Drupal\Core\StringTranslation\TranslatableMarkup|null
+   *   The description. A string or an instance of TranslatableMarkup will be
+   *   returned based on the way the description translation is handled. NULL if
+   *   no description is available.
    */
   public function getDescription();
 
-- 
GitLab