1
0
Fork 0
- added some missing type-hints
- added some documentation
- added some empty lines to `@return` statements (code-style convention)
This commit is contained in:
Roland Häder 2022-08-12 13:35:27 +02:00
commit 074bae33c9
Signed by: roland
GPG key ID: C82EDE5DDFA0BA77
12 changed files with 30 additions and 5 deletions

View 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

View file

@ -33,6 +33,7 @@ class Emoji extends BaseFactory
/**
* @param array $smilies
*
* @return Emojis
*/
public function createCollectionFromSmilies(array $smilies): Emojis

View file

@ -43,6 +43,7 @@ class Field extends BaseFactory
/**
* @param ProfileFields $profileFields
*
* @return Fields
* @throws HTTPException\InternalServerErrorException
*/

View 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);

View 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)) {

View 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
*/

View 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'];

View file

@ -41,6 +41,7 @@ class Tag extends BaseFactory
/**
* @param int $uriId Uri-ID of the item
*
* @return array
* @throws HTTPException\InternalServerErrorException
*/