mirror of
https://github.com/friendica/friendica
synced 2024-12-22 18:40:17 +00:00
Merge pull request #14599 from Art4/fix-phpstan-errors
Fix phpstan errors
This commit is contained in:
commit
2ebac8207f
2 changed files with 5 additions and 6 deletions
|
@ -4207,7 +4207,7 @@ class Item
|
||||||
if (!$mimetype) {
|
if (!$mimetype) {
|
||||||
try {
|
try {
|
||||||
$curlResult = DI::httpClient()->head($uri, [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::JSON_AS, HttpClientOptions::REQUEST => HttpClientRequest::ACTIVITYPUB]);
|
$curlResult = DI::httpClient()->head($uri, [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::JSON_AS, HttpClientOptions::REQUEST => HttpClientRequest::ACTIVITYPUB]);
|
||||||
$mimetype = empty($curlResult) ? '' : $curlResult->getContentType();
|
$mimetype = $curlResult->getContentType();
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
Logger::info('Error while fetching HTTP link via HEAD', ['uid' => $uid, 'uri' => $uri, 'code' => $th->getCode(), 'message' => $th->getMessage()]);
|
Logger::info('Error while fetching HTTP link via HEAD', ['uid' => $uid, 'uri' => $uri, 'code' => $th->getCode(), 'message' => $th->getMessage()]);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -4218,7 +4218,7 @@ class Item
|
||||||
try {
|
try {
|
||||||
// Issue 14126: Workaround for Mastodon servers that return "application/json" on a "head" request.
|
// Issue 14126: Workaround for Mastodon servers that return "application/json" on a "head" request.
|
||||||
$curlResult = HTTPSignature::fetchRaw($uri, $uid);
|
$curlResult = HTTPSignature::fetchRaw($uri, $uid);
|
||||||
$mimetype = empty($curlResult) ? '' : $curlResult->getContentType();
|
$mimetype = $curlResult->getContentType();
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
Logger::info('Error while fetching HTTP link via signed GET', ['uid' => $uid, 'uri' => $uri, 'code' => $th->getCode(), 'message' => $th->getMessage()]);
|
Logger::info('Error while fetching HTTP link via signed GET', ['uid' => $uid, 'uri' => $uri, 'code' => $th->getCode(), 'message' => $th->getMessage()]);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -166,10 +166,9 @@ final class ATProtocol
|
||||||
* Perform an XRPC post for a given user
|
* Perform an XRPC post for a given user
|
||||||
* @see https://atproto.com/specs/xrpc#lexicon-http-endpoints
|
* @see https://atproto.com/specs/xrpc#lexicon-http-endpoints
|
||||||
*
|
*
|
||||||
* @param integer $uid User ID
|
* @param int $uid User ID
|
||||||
* @param string $url Endpoints like "com.atproto.repo.createRecord"
|
* @param string $url Endpoints like "com.atproto.repo.createRecord"
|
||||||
* @param [type] $parameters array or StdClass with parameters
|
* @param array|stdClass $parameters array or StdClass with parameters
|
||||||
* @return stdClass|null
|
|
||||||
*/
|
*/
|
||||||
public function XRPCPost(int $uid, string $url, $parameters): ?stdClass
|
public function XRPCPost(int $uid, string $url, $parameters): ?stdClass
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue