Confirmed Incorrect phrase entity docblocks in Entities

DragonByte Tech

Well-known member
Licensed customer
Affected version
2.3.13
Multiple core entities have incorrect imports, and shortnames causes incorrect docblock hints that resolve to \XF\Phrase but should be \XF\Entity\Phrase. There's also a few incorrect return types where Phrase is included when only string is returned.

Diff block for all the affected entities and docblocks:
Diff:
diff --git a/src/XF/Entity/AbstractPrompt.php b/src/XF/Entity/AbstractPrompt.php
--- a/src/XF/Entity/AbstractPrompt.php
+++ b/src/XF/Entity/AbstractPrompt.php
@@ -17,7 +17,7 @@
  * @property-read Phrase|string $title
  *
  * RELATIONS
- * @property-read Phrase|null $MasterTitle
+ * @property-read \XF\Entity\Phrase|null $MasterTitle
  * @property-read AbstractPromptGroup|null $PromptGroup
  */
 abstract class AbstractPrompt extends Entity
diff --git a/src/XF/Entity/AbstractPromptGroup.php b/src/XF/Entity/AbstractPromptGroup.php
--- a/src/XF/Entity/AbstractPromptGroup.php
+++ b/src/XF/Entity/AbstractPromptGroup.php
@@ -17,7 +17,7 @@
  * @property-read Phrase|string $title
  *
  * RELATIONS
- * @property-read Phrase|null $MasterTitle
+ * @property-read \XF\Entity\Phrase|null $MasterTitle
  * @property-read AbstractCollection<\XF\Entity\AbstractPrompt> $Prompts
  */
 abstract class AbstractPromptGroup extends Entity
diff --git a/src/XF/Entity/ActivitySummaryDefinition.php b/src/XF/Entity/ActivitySummaryDefinition.php
--- a/src/XF/Entity/ActivitySummaryDefinition.php
+++ b/src/XF/Entity/ActivitySummaryDefinition.php
@@ -104,7 +104,7 @@
             {
                 $writeDevOutput = $this->getBehavior(DevOutputWritable::class)->getOption('write_dev_output');
 
-                /** @var Phrase $titlePhrase */
+                /** @var \XF\Entity\Phrase $titlePhrase */
                 $titlePhrase = $this->getExistingRelation('MasterTitle');
                 if ($titlePhrase)
                 {
@@ -115,7 +115,7 @@
                     $titlePhrase->save();
                 }
 
-                /** @var Phrase $descriptionPhrase */
+                /** @var \XF\Entity\Phrase $descriptionPhrase */
                 $descriptionPhrase = $this->getExistingRelation('MasterDescription');
                 if ($descriptionPhrase)
                 {
diff --git a/src/XF/Entity/AdminNavigation.php b/src/XF/Entity/AdminNavigation.php
--- a/src/XF/Entity/AdminNavigation.php
+++ b/src/XF/Entity/AdminNavigation.php
@@ -84,7 +84,7 @@
         {
             if ($this->isChanged('addon_id') || $this->isChanged('navigation_id'))
             {
-                /** @var Phrase $phrase */
+                /** @var \XF\Entity\Phrase $phrase */
                 $phrase = $this->getExistingRelation('MasterTitle');
                 if ($phrase)
                 {
@@ -112,7 +112,7 @@
     {
         $writeDevOutput = $this->getBehavior(DevOutputWritable::class)->getOption('write_dev_output');
 
-        /** @var Phrase $phrase */
+        /** @var \XF\Entity\Phrase $phrase */
         $phrase = $this->MasterTitle;
         if ($phrase)
         {
diff --git a/src/XF/Entity/AdminPermission.php b/src/XF/Entity/AdminPermission.php
--- a/src/XF/Entity/AdminPermission.php
+++ b/src/XF/Entity/AdminPermission.php
@@ -57,7 +57,7 @@
         {
             if ($this->isChanged('addon_id') || $this->isChanged('admin_permission_id'))
             {
-                /** @var Phrase $phrase */
+                /** @var \XF\Entity\Phrase $phrase */
                 $phrase = $this->getExistingRelation('MasterTitle');
                 if ($phrase)
                 {
diff --git a/src/XF/Entity/AdvertisingPosition.php b/src/XF/Entity/AdvertisingPosition.php
--- a/src/XF/Entity/AdvertisingPosition.php
+++ b/src/XF/Entity/AdvertisingPosition.php
@@ -89,7 +89,7 @@
             {
                 $writeDevOutput = $this->getBehavior(DevOutputWritable::class)->getOption('write_dev_output');
 
-                /** @var Phrase $titlePhrase */
+                /** @var \XF\Entity\Phrase $titlePhrase */
                 $titlePhrase = $this->getExistingRelation('MasterTitle');
                 if ($titlePhrase)
                 {
@@ -100,7 +100,7 @@
                     $titlePhrase->save();
                 }
 
-                /** @var Phrase $descriptionPhrase */
+                /** @var \XF\Entity\Phrase $descriptionPhrase */
                 $descriptionPhrase = $this->getExistingRelation('MasterDescription');
                 if ($descriptionPhrase)
                 {
diff --git a/src/XF/Entity/ApiScope.php b/src/XF/Entity/ApiScope.php
--- a/src/XF/Entity/ApiScope.php
+++ b/src/XF/Entity/ApiScope.php
@@ -92,7 +92,7 @@
         {
             if ($this->isChanged('addon_id') || $this->isChanged('api_scope_id'))
             {
-                /** @var Phrase $phrase */
+                /** @var \XF\Entity\Phrase $phrase */
                 $phrase = $this->getExistingRelation('MasterDescription');
                 if ($phrase)
                 {
diff --git a/src/XF/Entity/MemberStat.php b/src/XF/Entity/MemberStat.php
--- a/src/XF/Entity/MemberStat.php
+++ b/src/XF/Entity/MemberStat.php
@@ -221,7 +221,7 @@
         {
             if ($this->isChanged(['addon_id', 'member_stat_key']))
             {
-                /** @var Phrase $phrase */
+                /** @var \XF\Entity\Phrase $phrase */
                 $phrase = $this->getExistingRelation('MasterTitle');
                 if ($phrase)
                 {
diff --git a/src/XF/Entity/Navigation.php b/src/XF/Entity/Navigation.php
--- a/src/XF/Entity/Navigation.php
+++ b/src/XF/Entity/Navigation.php
@@ -259,7 +259,7 @@
         {
             if ($this->isChanged('addon_id') || $this->isChanged('navigation_id'))
             {
-                /** @var Phrase $phrase */
+                /** @var \XF\Entity\Phrase $phrase */
                 $phrase = $this->getExistingRelation('MasterTitle');
                 if ($phrase)
                 {
@@ -289,7 +289,7 @@
     {
         $writeDevOutput = $this->getBehavior(DevOutputWritable::class)->getOption('write_dev_output');
 
-        /** @var Phrase $phrase */
+        /** @var \XF\Entity\Phrase $phrase */
         $phrase = $this->MasterTitle;
         if ($phrase)
         {
diff --git a/src/XF/Entity/Option.php b/src/XF/Entity/Option.php
--- a/src/XF/Entity/Option.php
+++ b/src/XF/Entity/Option.php
@@ -659,7 +659,7 @@
             {
                 $writeDevOutput = $this->getBehavior(DevOutputWritable::class)->getOption('write_dev_output');
 
-                /** @var Phrase $titlePhrase */
+                /** @var \XF\Entity\Phrase $titlePhrase */
                 $titlePhrase = $this->getExistingRelation('MasterTitle');
                 if ($titlePhrase)
                 {
@@ -670,7 +670,7 @@
                     $titlePhrase->save();
                 }
 
-                /** @var Phrase $explainPhrase */
+                /** @var \XF\Entity\Phrase $explainPhrase */
                 $explainPhrase = $this->getExistingRelation('MasterExplain');
                 if ($explainPhrase)
                 {
diff --git a/src/XF/Entity/OptionGroup.php b/src/XF/Entity/OptionGroup.php
--- a/src/XF/Entity/OptionGroup.php
+++ b/src/XF/Entity/OptionGroup.php
@@ -90,7 +90,7 @@
             {
                 $writeDevOutput = $this->getBehavior(DevOutputWritable::class)->getOption('write_dev_output');
 
-                /** @var Phrase $titlePhrase */
+                /** @var \XF\Entity\Phrase $titlePhrase */
                 $titlePhrase = $this->getExistingRelation('MasterTitle');
                 if ($titlePhrase)
                 {
@@ -101,7 +101,7 @@
                     $titlePhrase->save();
                 }
 
-                /** @var Phrase $descriptionPhrase */
+                /** @var \XF\Entity\Phrase $descriptionPhrase */
                 $descriptionPhrase = $this->getExistingRelation('MasterDescription');
                 if ($descriptionPhrase)
                 {
diff --git a/src/XF/Entity/Permission.php b/src/XF/Entity/Permission.php
--- a/src/XF/Entity/Permission.php
+++ b/src/XF/Entity/Permission.php
@@ -92,7 +92,7 @@
         {
             if ($this->isChanged(['addon_id', 'permission_group_id', 'permission_id']))
             {
-                /** @var Phrase $phrase */
+                /** @var \XF\Entity\Phrase $phrase */
                 $phrase = $this->getExistingRelation('MasterTitle');
                 if ($phrase)
                 {
diff --git a/src/XF/Entity/PermissionInterfaceGroup.php b/src/XF/Entity/PermissionInterfaceGroup.php
--- a/src/XF/Entity/PermissionInterfaceGroup.php
+++ b/src/XF/Entity/PermissionInterfaceGroup.php
@@ -60,7 +60,7 @@
 
             if ($this->isChanged('addon_id') || $this->isChanged('interface_group_id'))
             {
-                /** @var Phrase $phrase */
+                /** @var \XF\Entity\Phrase $phrase */
                 $phrase = $this->getExistingRelation('MasterTitle');
                 if ($phrase)
                 {
diff --git a/src/XF/Entity/StyleProperty.php b/src/XF/Entity/StyleProperty.php
--- a/src/XF/Entity/StyleProperty.php
+++ b/src/XF/Entity/StyleProperty.php
@@ -7,7 +7,6 @@
 use XF\Mvc\Entity\Entity;
 use XF\Mvc\Entity\Structure;
 use XF\Phrase;
-use XF\PreEscaped;
 use XF\Repository\AddOnRepository;
 use XF\Repository\IconRepository;
 use XF\Repository\StylePropertyRepository;
@@ -41,8 +40,8 @@
  * @property-read \XF\Entity\Style $Style
  * @property Phrase $title
  * @property Phrase $description
- * @property-read Phrase|string $master_title
- * @property-read Phrase|PreEscaped|string $master_description
+ * @property-read string $master_title
+ * @property-read string $master_description
  * @property-read mixed $value_group_title
  *
  * RELATIONS
@@ -276,7 +275,7 @@
     }
 
     /**
-     * @return Phrase|string
+     * @return string
      */
     public function getMasterTitle()
     {
@@ -289,7 +288,7 @@
     }
 
     /**
-     * @return Phrase|PreEscaped|string
+     * @return string
      */
     public function getMasterDescription()
     {
@@ -328,7 +327,7 @@
     /**
      * @param bool $title
      *
-     * @return null|Phrase
+     * @return \XF\Entity\Phrase|null
      */
     public function getMasterPhrase($title)
     {
diff --git a/src/XF/Entity/StylePropertyGroup.php b/src/XF/Entity/StylePropertyGroup.php
--- a/src/XF/Entity/StylePropertyGroup.php
+++ b/src/XF/Entity/StylePropertyGroup.php
@@ -24,8 +24,8 @@
  * @property-read Style $Style
  * @property Phrase|string $title
  * @property Phrase|string $description
- * @property-read Phrase|string $master_title
- * @property-read Phrase|string $master_description
+ * @property-read string $master_title
+ * @property-read string $master_description
  *
  * RELATIONS
  * @property-read AddOn|null $AddOn
@@ -87,7 +87,7 @@
     }
 
     /**
-     * @return Phrase|string
+     * @return string
      */
     public function getMasterTitle()
     {
@@ -100,7 +100,7 @@
     }
 
     /**
-     * @return Phrase|string
+     * @return string
      */
     public function getMasterDescription()
     {
@@ -121,7 +121,7 @@
     /**
      * @param bool $title
      *
-     * @return Phrase|null
+     * @return \XF\Entity\Phrase|null
      */
     public function getMasterPhrase($title)
     {
diff --git a/src/XF/Entity/WidgetDefinition.php b/src/XF/Entity/WidgetDefinition.php
--- a/src/XF/Entity/WidgetDefinition.php
+++ b/src/XF/Entity/WidgetDefinition.php
@@ -107,7 +107,7 @@
             {
                 $writeDevOutput = $this->getBehavior(DevOutputWritable::class)->getOption('write_dev_output');
 
-                /** @var Phrase $titlePhrase */
+                /** @var \XF\Entity\Phrase $titlePhrase */
                 $titlePhrase = $this->getExistingRelation('MasterTitle');
                 if ($titlePhrase)
                 {
@@ -118,7 +118,7 @@
                     $titlePhrase->save();
                 }
 
-                /** @var Phrase $descriptionPhrase */
+                /** @var \XF\Entity\Phrase $descriptionPhrase */
                 $descriptionPhrase = $this->getExistingRelation('MasterDescription');
                 if ($descriptionPhrase)
                 {
diff --git a/src/XF/Entity/WidgetPosition.php b/src/XF/Entity/WidgetPosition.php
--- a/src/XF/Entity/WidgetPosition.php
+++ b/src/XF/Entity/WidgetPosition.php
@@ -89,7 +89,7 @@
             {
                 $writeDevOutput = $this->getBehavior(DevOutputWritable::class)->getOption('write_dev_output');
 
-                /** @var Phrase $titlePhrase */
+                /** @var \XF\Entity\Phrase $titlePhrase */
                 $titlePhrase = $this->getExistingRelation('MasterTitle');
                 if ($titlePhrase)
                 {
@@ -100,7 +100,7 @@
                     $titlePhrase->save();
                 }
 
-                /** @var Phrase $descriptionPhrase */
+                /** @var \XF\Entity\Phrase $descriptionPhrase */
                 $descriptionPhrase = $this->getExistingRelation('MasterDescription');
                 if ($descriptionPhrase)
                 {
 
Back
Top Bottom