]> git.mxchange.org Git - friendica.git/commitdiff
Changes:
authorRoland Häder <roland@mxchange.org>
Fri, 12 Aug 2022 11:35:27 +0000 (13:35 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 12 Aug 2022 11:36:34 +0000 (13:36 +0200)
- added some missing type-hints
- added some documentation
- added some empty lines to `@return` statements (code-style convention)

12 files changed:
src/Factory/Api/Mastodon/Application.php
src/Factory/Api/Mastodon/Emoji.php
src/Factory/Api/Mastodon/Field.php
src/Factory/Api/Mastodon/Notification.php
src/Factory/Api/Mastodon/Poll.php
src/Factory/Api/Mastodon/Relationship.php
src/Factory/Api/Mastodon/Status.php
src/Factory/Api/Mastodon/Tag.php
src/Factory/Api/Twitter/Attachment.php
src/Factory/Api/Twitter/Hashtag.php
src/Factory/Api/Twitter/Media.php
src/Factory/Api/Twitter/User.php

index edb88619acda2d61c7dea9da04146ac527305a46..fb305e5e78e6a6b3513a04e1ae0ede26fd7d91cd 100644 (file)
@@ -41,7 +41,6 @@ class Application extends BaseFactory
         * @param int $id Application ID
         *
         * @return \Friendica\Object\Api\Mastodon\Application
-        *
         * @throws UnprocessableEntityException
         */
        public function createFromApplicationId(int $id): \Friendica\Object\Api\Mastodon\Application
index 6161377849ff8bf66e69221aa8ceab9c478b40e4..17ec51580d39ecd5f1e849569ad4cb8b073ab099 100644 (file)
@@ -33,6 +33,7 @@ class Emoji extends BaseFactory
 
        /**
         * @param array $smilies
+        *
         * @return Emojis
         */
        public function createCollectionFromSmilies(array $smilies): Emojis
index 52d1a87d412cdf324ca3b3c9c6f6d826429d2cfd..adfedde199938f50bfb6da3a9870d901f57ac0a0 100644 (file)
@@ -43,6 +43,7 @@ class Field extends BaseFactory
 
        /**
         * @param ProfileFields $profileFields
+        *
         * @return Fields
         * @throws HTTPException\InternalServerErrorException
         */
index 5bd2cca4c76e21357f4e29467ece1499c778f09d..33c252e4f173a0c72a5175db788406e17c65e522 100644 (file)
@@ -45,6 +45,12 @@ class Notification extends BaseFactory
                $this->mstdnStatusFactory  = $mstdnStatusFactoryFactory;
        }
 
+       /**
+        * @param Notifications\Entity\Notification $Notification
+        *
+        * @return MstdnNotification
+        * @throws UnexpectedNotificationTypeException
+        */
        public function createFromNotification(Notifications\Entity\Notification $Notification): MstdnNotification
        {
                $type = self::getType($Notification);
index f1a939723078efe4b499c5a814cb9d17c0fbf10f..4445b11d76174cfe155031aa1f08dfdd7e8289be 100644 (file)
@@ -31,8 +31,11 @@ class Poll extends BaseFactory
        /**
         * @param int $id  Id the question
         * @param int $uid Item user
+        *
+        * @return \Friendica\Object\Api\Mastodon\Poll
+        * @throws HTTPException\NotFoundException
         */
-       public function createFromId(int $id, $uid = 0): \Friendica\Object\Api\Mastodon\Poll
+       public function createFromId(int $id, int $uid = 0): \Friendica\Object\Api\Mastodon\Poll
        {
                $question = Post\Question::getById($id);
                if (empty($question)) {
index 6035b61f9c8ef3cbf05ccbb3d27109419083c38c..6d78b50c2197957f8aea75ff6f4ec9d471dd1eaa 100644 (file)
@@ -31,6 +31,7 @@ class Relationship extends BaseFactory
        /**
         * @param int $contactId Contact ID (public or user contact)
         * @param int $uid User ID
+        *
         * @return RelationshipEntity
         * @throws Exception
         */
index 0fc9281dbef837a68cf35110999606fdadff8bf5..0cce6cb03736cbf77f26de34b11e046b3e191843 100644 (file)
@@ -78,7 +78,7 @@ class Status extends BaseFactory
         * @throws HTTPException\InternalServerErrorException
         * @throws ImagickException|HTTPException\NotFoundException
         */
-       public function createFromUriId(int $uriId, $uid = 0): \Friendica\Object\Api\Mastodon\Status
+       public function createFromUriId(int $uriId, int $uid = 0): \Friendica\Object\Api\Mastodon\Status
        {
                $fields = ['uri-id', 'uid', 'author-id', 'author-uri-id', 'author-link', 'starred', 'app', 'title', 'body', 'raw-body', 'content-warning', 'question-id',
                        'created', 'network', 'thr-parent-id', 'parent-author-id', 'language', 'uri', 'plink', 'private', 'vid', 'gravity', 'featured', 'has-media'];
index 87a6fd5c95d9d7638fb4b821c362b0f1b0072a09..1b7eefe47201cf8f29b07ee16ce0675faf96b837 100644 (file)
@@ -41,6 +41,7 @@ class Tag extends BaseFactory
 
        /**
         * @param int $uriId Uri-ID of the item
+        *
         * @return array
         * @throws HTTPException\InternalServerErrorException
         */
index b811c4824d4fe1bdab7acfb77934d44a04b656be..c5fa8d90a3bfad5a94be7510acdc4304f4e96c0a 100644 (file)
@@ -35,6 +35,7 @@ class Attachment extends BaseFactory
 
        /**
         * @param int $uriId Uri-ID of the attachments
+        *
         * @return array
         * @throws HTTPException\InternalServerErrorException
         */
index 14be6eb0b2ac021fccc69074e27f11072cdd77db..329d80207d018a20f26ae1a582b6e2660f8d3213 100644 (file)
@@ -35,6 +35,8 @@ class Hashtag extends BaseFactory
 
        /**
         * @param int $uriId Uri-ID of the attachments
+        * @param string $text
+        *
         * @return array
         * @throws HTTPException\InternalServerErrorException
         */
index baf4650cff63e1e1847ac6b4564e5229f66c3c50..ba588583c67d7fb561e4443a8ffaf6a008fbb61a 100644 (file)
@@ -41,6 +41,8 @@ class Media extends BaseFactory
 
        /**
         * @param int $uriId Uri-ID of the attachments
+        * @param string $text
+        *
         * @return array
         * @throws HTTPException\InternalServerErrorException
         */
index f7040cefa976a5a7057096701dfd9f2f4aaeb45c..6d4b8784eaf1771795085caf6ead3f542a9e679c 100644 (file)
@@ -47,11 +47,12 @@ class User extends BaseFactory
         * @param int  $uid Public contact (=0) or owner user id
         * @param bool $skip_status
         * @param bool $include_user_entities
+        *
         * @return \Friendica\Object\Api\Twitter\User
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public function createFromContactId(int $contactId, int $uid = 0, bool $skip_status = true, bool $include_user_entities = true)
+       public function createFromContactId(int $contactId, int $uid = 0, bool $skip_status = true, bool $include_user_entities = true): \Friendica\Object\Api\Twitter\User
        {
                $cdata = Contact::getPublicAndUserContactID($contactId, $uid);
                if (!empty($cdata)) {
@@ -78,7 +79,14 @@ class User extends BaseFactory
                return new \Friendica\Object\Api\Twitter\User($publicContact, $apcontact, $userContact, $status, $include_user_entities);
        }
 
-       public function createFromUserId(int $uid, bool $skip_status = true, bool $include_user_entities = true)
+       /**
+        * @param int  $uid Public contact (=0) or owner user id
+        * @param bool $skip_status
+        * @param bool $include_user_entities
+        *
+        * @return \Friendica\Object\Api\Twitter\User
+        */
+       public function createFromUserId(int $uid, bool $skip_status = true, bool $include_user_entities = true): \Friendica\Object\Api\Twitter\User
        {
                return $this->createFromContactId(Contact::getPublicIdByUserId($uid), $uid, $skip_status, $include_user_entities);
        }