mirror of
https://github.com/friendica/friendica
synced 2025-01-08 06:04:44 +00:00
Fix PHPStan errors from upstream
This commit is contained in:
parent
1b4d0d0bb0
commit
ae2b6e3bb7
1 changed files with 13 additions and 4 deletions
|
@ -129,17 +129,26 @@ final class ATProtocol
|
|||
}
|
||||
|
||||
$data = $this->get($pds . '/xrpc/' . $url, [HttpClientOptions::HEADERS => $headers]);
|
||||
if (empty($data) || (!empty($data->code) && ($data->code < 200 || $data->code >= 400))) {
|
||||
|
||||
if ($data === null) {
|
||||
$this->pConfig->set($uid, 'bluesky', 'status', self::STATUS_API_FAIL);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!empty($data->code) && ($data->code < 200 || $data->code >= 400)) {
|
||||
if (!empty($data->message)) {
|
||||
$this->pConfig->set($uid, 'bluesky', 'status-message', $data->message);
|
||||
} elseif (!empty($data->code)) {
|
||||
$this->pConfig->set($uid, 'bluesky', 'status-message', 'Error Code: ' . $data->code);
|
||||
}
|
||||
} elseif (!empty($data)) {
|
||||
$this->pConfig->set($uid, 'bluesky', 'status', self::STATUS_SUCCESS);
|
||||
$this->pConfig->set($uid, 'bluesky', 'status-message', '');
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
$this->pConfig->set($uid, 'bluesky', 'status', self::STATUS_SUCCESS);
|
||||
$this->pConfig->set($uid, 'bluesky', 'status-message', '');
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue