* @property-read int|null $parentUriId
* @property-read int|null $id
*
- * @deprecated since 2022.05 Use \Friendica\Navigation\Notifications\Entity\Notification instead
+ * @deprecated 2022.05 Use \Friendica\Navigation\Notifications\Entity\Notification instead
+ * @see \Friendica\Navigation\Notifications\Entity\Notification
*/
class Notify extends BaseEntity
{
protected $edited_at;
/** @var string|null */
protected $in_reply_to_id = null;
- /** @var Status|null - Fedilab extension, see issue https://github.com/friendica/friendica/issues/12672 */
+ /** @var Status[]|null - Fedilab extension, see issue https://github.com/friendica/friendica/issues/12672 */
protected $in_reply_to_status = null;
/** @var string|null */
protected $in_reply_to_account_id = null;
protected $pinned = false;
/** @var string */
protected $content;
- /** @var Status|null */
+ /** @var Status[]|null */
protected $reblog = null;
- /** @var Status|null - Akkoma extension, see issue https://github.com/friendica/friendica/issues/12603 */
+ /** @var Status[]|null - Akkoma extension, see issue https://github.com/friendica/friendica/issues/12603 */
protected $quote = null;
/** @var Application */
protected $application = null;
- /** @var Account */
+ /** @var array */
protected $account;
- /** @var Attachment */
+ /** @var Attachment[] */
protected $media_attachments = [];
- /** @var Mention */
+ /** @var Mention[] */
protected $mentions = [];
- /** @var Tag */
+ /** @var Tag[] */
protected $tags = [];
/** @var Emoji[] */
protected $emojis = [];
- /** @var Card|null */
+ /** @var array|null */
protected $card = null;
- /** @var Poll|null */
+ /** @var array|null */
protected $poll = null;
/** @var FriendicaExtension */
protected $friendica;
protected $sender_screen_name = null;
/** @var string */
protected $recipient_screen_name = null;
- /** @var User */
+ /** @var array */
protected $sender;
- /** @var User */
+ /** @var array */
protected $recipient;
/** @var string|null */
protected $title;
protected $media_url;
/** @var string */
protected $media_url_https;
- /** @var string */
+ /** @var array<string, array<string, mixed>> */
protected $sizes;
/** @var string */
protected $type;
namespace Friendica\Object\Api\Twitter;
-use Friendica\App\BaseURL;
use Friendica\BaseDataTransferObject;
/**
*/
public function __construct(array $tag, array $contact, array $indices)
{
- $this->id = (string)($contact['id'] ?? 0);
+ $this->id = (int)($contact['id'] ?? 0);
$this->id_str = (string)($contact['id'] ?? 0);
$this->indices = $indices;
$this->name = $tag['name'];
protected $geo;
/** @var bool */
protected $favorited = false;
- /** @var User */
+ /** @var array */
protected $user;
- /** @var User */
+ /** @var array */
protected $friendica_author;
- /** @var User */
+ /** @var array */
protected $friendica_owner;
/** @var bool */
protected $friendica_private;
protected $friendica_html;
/** @var int */
protected $friendica_comments;
- /** @var Status|null */
+ /** @var array|null */
protected $retweeted_status = null;
- /** @var Status|null */
+ /** @var array|null */
protected $quoted_status = null;
/** @var array */
protected $attachments;
/** @var string */
public $message = null;
- /** @var string */
+ /** @var string|null */
public $data = null;
/** @var string */
private $parent = null;
/**
- * @var Thread
+ * @var Thread|null
*/
private $thread = null;
private $redirect_url = null;
* Get a child by its ID
*
* @param integer $id The child id
- * @return Thread|null Thread or NULL if not found
+ * @return Post|null Post or NULL if not found
*/
public function getChild(int $id)
{
break;
default:
DI::logger()->info('[ERROR] Conversation::setMode : Unhandled mode ('. $mode .').');
- return false;
- break;
+ return;
}
$this->mode = $mode;
}
namespace Friendica\Profile\ProfileField\Collection;
use Friendica\BaseCollection;
-use Friendica\Profile\ProfileField\Entity;
+use Friendica\Profile\ProfileField\Entity\ProfileField as ProfileFieldEntity;
class ProfileFields extends BaseCollection
{
- public function current(): Entity\ProfileField
+ public function current(): ProfileFieldEntity
{
return parent::current();
}
- /**
- * @param callable $callback
- * @return ProfileFields (as an extended form of BaseCollection)
- */
- public function map(callable $callback): BaseCollection
+ public function map(callable $callback): ProfileFields
{
- return parent::map($callback);
+ $class = get_class($this);
+
+ return new $class(array_map($callback, $this->getArrayCopy()), $this->getTotalCount());
}
- /**
- * @param callable|null $callback
- * @param int $flag
- * @return ProfileFields as an extended version of BaseCollection
- */
- public function filter(callable $callback = null, int $flag = 0): BaseCollection
+ public function filter(?callable $callback = null, int $flag = 0): ProfileFields
{
- return parent::filter($callback, $flag);
+ $class = get_class($this);
+
+ return new $class(array_filter($this->getArrayCopy(), $callback, $flag));
}
}