diff --git a/src/Navigation/Notifications/Entity/Notify.php b/src/Navigation/Notifications/Entity/Notify.php index 297ecbdd98..71308772a9 100644 --- a/src/Navigation/Notifications/Entity/Notify.php +++ b/src/Navigation/Notifications/Entity/Notify.php @@ -14,7 +14,7 @@ use Friendica\Core\Renderer; use Psr\Http\Message\UriInterface; /** - * @property-read string $type + * @property-read int $type * @property-read string $name * @property-read UriInterface $url * @property-read UriInterface $photo diff --git a/src/Object/Api/Friendica/Notification.php b/src/Object/Api/Friendica/Notification.php index bff10accae..f83cd9cc2c 100644 --- a/src/Object/Api/Friendica/Notification.php +++ b/src/Object/Api/Friendica/Notification.php @@ -62,29 +62,29 @@ class Notification extends BaseDataTransferObject /** @var string Message (Plaintext) */ protected $msg_plain; - public function __construct(Notify $Notify) + public function __construct(Notify $notify) { - $this->id = $Notify->id; - $this->type = $Notify->type; - $this->name = $Notify->name; - $this->url = $Notify->url->__toString(); - $this->photo = $Notify->photo->__toString(); - $this->date = DateTimeFormat::local($Notify->date->format(DateTimeFormat::MYSQL)); - $this->msg = $Notify->msg; - $this->uid = $Notify->uid; - $this->link = $Notify->link->__toString(); - $this->iid = $Notify->itemId; - $this->parent = $Notify->parent; - $this->seen = $Notify->seen; - $this->verb = $Notify->verb; - $this->otype = $Notify->otype; - $this->name_cache = $Notify->name_cache; - $this->msg_cache = $Notify->msg_cache; - $this->timestamp = $Notify->date->format('U'); + $this->id = $notify->id; + $this->type = $notify->type; + $this->name = $notify->name; + $this->url = $notify->url->__toString(); + $this->photo = $notify->photo->__toString(); + $this->date = DateTimeFormat::local($notify->date->format(DateTimeFormat::MYSQL)); + $this->msg = $notify->msg; + $this->uid = $notify->uid; + $this->link = $notify->link->__toString(); + $this->iid = $notify->itemId; + $this->parent = $notify->parent; + $this->seen = $notify->seen; + $this->verb = $notify->verb; + $this->otype = $notify->otype; + $this->name_cache = $notify->name_cache; + $this->msg_cache = $notify->msg_cache; + $this->timestamp = (int) $notify->date->format('U'); $this->date_rel = Temporal::getRelativeDate($this->date); try { - $this->msg_html = BBCode::convertForUriId($Notify->uriId, $this->msg, BBCode::EXTERNAL); + $this->msg_html = BBCode::convertForUriId($notify->uriId, $this->msg, BBCode::EXTERNAL); } catch (\Exception $e) { $this->msg_html = ''; } diff --git a/src/Object/Api/Mastodon/Field.php b/src/Object/Api/Mastodon/Field.php index cf1983f2fe..846aac4d0f 100644 --- a/src/Object/Api/Mastodon/Field.php +++ b/src/Object/Api/Mastodon/Field.php @@ -20,7 +20,7 @@ class Field extends BaseDataTransferObject protected $name; /** @var string (HTML) */ protected $value; - /** @var string (Datetime)*/ + /** @var string|null (Datetime)*/ protected $verified_at; public function __construct(string $name, string $value) diff --git a/src/Object/Api/Mastodon/Notification.php b/src/Object/Api/Mastodon/Notification.php index e5593bfc82..b18a7f1e9e 100644 --- a/src/Object/Api/Mastodon/Notification.php +++ b/src/Object/Api/Mastodon/Notification.php @@ -44,9 +44,9 @@ class Notification extends BaseDataTransferObject protected $created_at; /** @var bool */ protected $dismissed; - /** @var Account */ + /** @var array */ protected $account; - /** @var Status|null */ + /** @var array|null */ protected $status = null; /** diff --git a/src/Object/Api/Mastodon/Poll.php b/src/Object/Api/Mastodon/Poll.php index 3d2e6c8f25..a17e8c57b5 100644 --- a/src/Object/Api/Mastodon/Poll.php +++ b/src/Object/Api/Mastodon/Poll.php @@ -32,7 +32,7 @@ class Poll extends BaseDataTransferObject /** @var bool|null */ protected $voted = false; /** @var array|null */ - protected $own_votes = false; + protected $own_votes = null; /** @var array */ protected $options = []; /** @var Emoji[] */ diff --git a/src/Object/Api/Mastodon/Relationship.php b/src/Object/Api/Mastodon/Relationship.php index 1d708425cd..2e9faf4d0b 100644 --- a/src/Object/Api/Mastodon/Relationship.php +++ b/src/Object/Api/Mastodon/Relationship.php @@ -18,7 +18,7 @@ use Friendica\Util\Network; */ class Relationship extends BaseDataTransferObject { - /** @var int */ + /** @var string */ protected $id; /** @var bool */ protected $following = false; @@ -88,7 +88,5 @@ class Relationship extends BaseDataTransferObject $this->blocking = (bool)($contactRecord['blocked'] ?? false) || $blocked; $this->note = $contactRecord['info']; } - - return $this; } } diff --git a/src/Object/Api/Mastodon/ScheduledStatus.php b/src/Object/Api/Mastodon/ScheduledStatus.php index ac4bf029c2..630ebd7839 100644 --- a/src/Object/Api/Mastodon/ScheduledStatus.php +++ b/src/Object/Api/Mastodon/ScheduledStatus.php @@ -35,7 +35,7 @@ class ScheduledStatus extends BaseDataTransferObject 'in_reply_to_id' => null, 'application_id' => '' ]; - /** @var Attachment */ + /** @var array */ protected $media_attachments = []; /** diff --git a/src/Object/Api/Mastodon/Status.php b/src/Object/Api/Mastodon/Status.php index 474db28dc0..77b49f685d 100644 --- a/src/Object/Api/Mastodon/Status.php +++ b/src/Object/Api/Mastodon/Status.php @@ -68,7 +68,7 @@ class Status extends BaseDataTransferObject protected $reblog = null; /** @var Status[]|null - Akkoma extension, see issue https://github.com/friendica/friendica/issues/12603 */ protected $quote = null; - /** @var Application */ + /** @var array */ protected $application = null; /** @var array */ protected $account;