1
0
Fork 0

Merge pull request #12364 from MrPetovan/bug/warnings

Address several warning messages
This commit is contained in:
Michael Vogel 2022-12-10 18:10:24 +01:00 committed by GitHub
commit 46660c9462
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 70 additions and 35 deletions

View file

@ -234,6 +234,18 @@ class DiasporaContact extends BaseRepository
*/
public function updateFromProbeArray(array $data): Entity\DiasporaContact
{
if (empty($data['url'])) {
throw new \InvalidArgumentException('Missing url key in Diaspora probe data array');
}
if (empty($data['guid'])) {
throw new \InvalidArgumentException('Missing guid key in Diaspora probe data array');
}
if (empty($data['pubkey'])) {
throw new \InvalidArgumentException('Missing pubkey key in Diaspora probe data array');
}
$uriId = ItemURI::insert(['uri' => $data['url'], 'guid' => $data['guid']]);
$contact = Contact::getByUriId($uriId, ['id', 'created']);