mirror of
https://github.com/friendica/friendica
synced 2025-05-12 23:44:10 +02:00
Reduce cyclomatic complexity in APContact::getByURL()
This commit is contained in:
parent
c83099c8d0
commit
6684f0d5c7
1 changed files with 9 additions and 0 deletions
|
@ -207,6 +207,15 @@ class APContact
|
|||
return $fetched_contact;
|
||||
}
|
||||
|
||||
return self::compactProfile($apcontact, $compacted, $url, $fetched_contact, $webfinger, $local_owner);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|bool $fetched_contact
|
||||
* @param array|bool $local_owner
|
||||
*/
|
||||
private static function compactProfile(array $apcontact, array $compacted, string $url, $fetched_contact, bool $webfinger, $local_owner): array
|
||||
{
|
||||
$apcontact['url'] = $compacted['@id'];
|
||||
$apcontact['uuid'] = JsonLD::fetchElement($compacted, 'diaspora:guid', '@value');
|
||||
$apcontact['type'] = str_replace('as:', '', JsonLD::fetchElement($compacted, '@type'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue