Cleanup Code

This commit is contained in:
Philipp 2021-06-09 00:09:32 +02:00
parent 263774eb46
commit d4387d45ee
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
18 changed files with 86 additions and 78 deletions

View file

@ -27,6 +27,7 @@ use Friendica\Model\APContact;
use Friendica\Model\Contact;
use Friendica\Model\Introduction;
use Friendica\Network\HTTPException;
use ImagickException;
use Psr\Log\LoggerInterface;
class FollowRequest extends BaseFactory
@ -44,10 +45,9 @@ class FollowRequest extends BaseFactory
/**
* @param Introduction $introduction
* @return \Friendica\Object\Api\Mastodon\FollowRequest
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
* @throws ImagickException|HTTPException\InternalServerErrorException
*/
public function createFromIntroduction(Introduction $introduction)
public function createFromIntroduction(Introduction $introduction): \Friendica\Object\Api\Mastodon\FollowRequest
{
$cdata = Contact::getPublicAndUserContacID($introduction->{'contact-id'}, $introduction->uid);
@ -57,10 +57,10 @@ class FollowRequest extends BaseFactory
}
$publicContact = Contact::getById($cdata['public']);
$userContact = Contact::getById($cdata['user']);
$userContact = Contact::getById($cdata['user']);
$apcontact = APContact::getByURL($publicContact['url'], false);
$apContact = APContact::getByURL($publicContact['url'], false);
return new \Friendica\Object\Api\Mastodon\FollowRequest($this->baseUrl, $introduction->id, $publicContact, $apcontact, $userContact);
return new \Friendica\Object\Api\Mastodon\FollowRequest($this->baseUrl, $introduction->id, $publicContact, $apContact, $userContact);
}
}