]> git.mxchange.org Git - friendica.git/commitdiff
Account for null value in Entity\Notify->msg
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 28 Apr 2023 03:00:48 +0000 (23:00 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 28 Apr 2023 03:00:48 +0000 (23:00 -0400)
- Update possible types of entity properties

src/Navigation/Notifications/Entity/Notify.php
src/Navigation/Notifications/Factory/FormattedNotify.php

index 8de40910b6ed32f680254074f8f49c40177c8b2c..b7a007a2f0fe82ebee7a5c5ff5b1647bd0217b46 100644 (file)
@@ -61,15 +61,15 @@ class Notify extends BaseEntity
        protected $photo;
        /** @var DateTime */
        protected $date;
-       /** @var string */
+       /** @var string|null */
        protected $msg;
        /** @var int */
        protected $uid;
        /** @var UriInterface */
        protected $link;
-       /** @var int */
+       /** @var int|null */
        protected $itemId;
-       /** @var int */
+       /** @var int|null */
        protected $parent;
        /** @var bool */
        protected $seen;
@@ -79,13 +79,13 @@ class Notify extends BaseEntity
        protected $otype;
        /** @var string */
        protected $name_cache;
-       /** @var string */
+       /** @var string|null */
        protected $msg_cache;
        /** @var int|null */
        protected $uriId;
        /** @var int|null */
        protected $parentUriId;
-       /** @var int */
+       /** @var int|null */
        protected $id;
 
        public function __construct(int $type, string $name, UriInterface $url, UriInterface $photo, DateTime $date, int $uid, UriInterface $link, bool $seen, string $verb, string $otype, string $name_cache, string $msg = null, string $msg_cache = null, int $itemId = null, int $uriId = null, int $parent = null, ?int $parentUriId = null, ?int $id = null)
index b34aa74eb9fa5a06e6f9e00b67b558144c776959..33abf63e4896e3a6411fa5ca8f232adb8ea7b3b7 100644 (file)
@@ -222,7 +222,7 @@ class FormattedNotify extends BaseFactory
                                        $this->baseUrl . '/notify/' . $Notify->id,
                                        Contact::getAvatarUrlForUrl($Notify->url, $Notify->uid, Proxy::SIZE_MICRO),
                                        $Notify->url,
-                                       strip_tags(BBCode::toPlaintext($Notify->msg)),
+                                       strip_tags(BBCode::toPlaintext($Notify->msg ?? '')),
                                        DateTimeFormat::local($Notify->date->format(DateTimeFormat::MYSQL), 'r'),
                                        Temporal::getRelativeDate($Notify->date->format(DateTimeFormat::MYSQL)),
                                        $Notify->seen