From: Roland Häder Date: Thu, 16 Jun 2022 18:01:09 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2766c7d9cf6b9f592b4426297b681219538cb810;p=friendica.git Continued: - added more type-hints - added some missing documentation --- diff --git a/src/Factory/Api/Mastodon/Account.php b/src/Factory/Api/Mastodon/Account.php index d0c654fc21..0a647787a8 100644 --- a/src/Factory/Api/Mastodon/Account.php +++ b/src/Factory/Api/Mastodon/Account.php @@ -57,7 +57,7 @@ class Account extends BaseFactory * @throws HTTPException\InternalServerErrorException * @throws ImagickException|HTTPException\NotFoundException */ - public function createFromContactId(int $contactId, $uid = 0): \Friendica\Object\Api\Mastodon\Account + public function createFromContactId(int $contactId, int $uid = 0): \Friendica\Object\Api\Mastodon\Account { $contact = Contact::getById($contactId, ['uri-id']); if (empty($contact)) { @@ -74,7 +74,7 @@ class Account extends BaseFactory * @throws HTTPException\InternalServerErrorException * @throws ImagickException|HTTPException\NotFoundException */ - public function createFromUriId(int $contactUriId, $uid = 0): \Friendica\Object\Api\Mastodon\Account + public function createFromUriId(int $contactUriId, int $uid = 0): \Friendica\Object\Api\Mastodon\Account { $account = DBA::selectFirst('account-user-view', [], ['uri-id' => $contactUriId, 'uid' => [0, $uid]], ['order' => ['id' => true]]); if (empty($account)) { diff --git a/src/Factory/Api/Twitter/Status.php b/src/Factory/Api/Twitter/Status.php index ed138e2bdb..123fd3dcf0 100644 --- a/src/Factory/Api/Twitter/Status.php +++ b/src/Factory/Api/Twitter/Status.php @@ -70,6 +70,7 @@ class Status extends BaseFactory /** * @param int $uriId Uri-ID of the item * @param int $uid Item user + * @param bool $include_entities Whether to include entities * * @return \Friendica\Object\Api\Twitter\Status * @throws HTTPException\InternalServerErrorException @@ -90,12 +91,13 @@ class Status extends BaseFactory /** * @param int $uriId Uri-ID of the item * @param int $uid Item user + * @param bool $include_entities Whether to include entities * * @return \Friendica\Object\Api\Twitter\Status * @throws HTTPException\InternalServerErrorException * @throws ImagickException|HTTPException\NotFoundException */ - public function createFromUriId(int $uriId, $uid = 0, $include_entities = false): \Friendica\Object\Api\Twitter\Status + public function createFromUriId(int $uriId, int $uid = 0, bool $include_entities = false): \Friendica\Object\Api\Twitter\Status { $fields = ['parent-uri-id', 'uri-id', 'uid', 'author-id', 'author-link', 'author-network', 'owner-id', 'causer-id', 'starred', 'app', 'title', 'body', 'raw-body', 'created', 'network','post-reason', 'language', 'gravity', @@ -110,6 +112,7 @@ class Status extends BaseFactory /** * @param array $item item array * @param int $uid Item user + * @param bool $include_entities Whether to include entities * * @return \Friendica\Object\Api\Twitter\Status * @throws HTTPException\InternalServerErrorException diff --git a/src/Factory/Api/Twitter/User.php b/src/Factory/Api/Twitter/User.php index 6dd19ede3a..f7040cefa9 100644 --- a/src/Factory/Api/Twitter/User.php +++ b/src/Factory/Api/Twitter/User.php @@ -51,7 +51,7 @@ class User extends BaseFactory * @throws HTTPException\InternalServerErrorException * @throws \ImagickException */ - public function createFromContactId(int $contactId, $uid = 0, $skip_status = true, $include_user_entities = true) + public function createFromContactId(int $contactId, int $uid = 0, bool $skip_status = true, bool $include_user_entities = true) { $cdata = Contact::getPublicAndUserContactID($contactId, $uid); if (!empty($cdata)) { @@ -78,7 +78,7 @@ class User extends BaseFactory return new \Friendica\Object\Api\Twitter\User($publicContact, $apcontact, $userContact, $status, $include_user_entities); } - public function createFromUserId(int $uid, $skip_status = true, $include_user_entities = true) + public function createFromUserId(int $uid, bool $skip_status = true, bool $include_user_entities = true) { return $this->createFromContactId(Contact::getPublicIdByUserId($uid), $uid, $skip_status, $include_user_entities); }