1
0
Fork 0

Merge pull request #11689 from Quix0r/rewrites/double-quotes-single

Changed more double-quotes to single
This commit is contained in:
Hypolite Petovan 2022-06-25 12:02:01 -04:00 committed by GitHub
commit 3c70d592f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 99 additions and 63 deletions

View file

@ -1958,7 +1958,7 @@ class Contact
* @param string $updated Contact update date
* @return string avatar link
*/
public static function getAvatarUrlForId(int $cid, string $size = '', string $updated = '', string $guid = ''):string
public static function getAvatarUrlForId(int $cid, string $size = '', string $updated = '', string $guid = ''): string
{
// We have to fetch the "updated" variable when it wasn't provided
// The parameter can be provided to improve performance
@ -1999,7 +1999,7 @@ class Contact
* @param string $size One of the Proxy::SIZE_* constants
* @return string avatar link
*/
public static function getAvatarUrlForUrl(string $url, int $uid, string $size = ''):string
public static function getAvatarUrlForUrl(string $url, int $uid, string $size = ''): string
{
$condition = ["`nurl` = ? AND ((`uid` = ? AND `network` IN (?, ?)) OR `uid` = ?)",
Strings::normaliseLink($url), $uid, Protocol::FEED, Protocol::MAIL, 0];
@ -2015,7 +2015,7 @@ class Contact
* @param string $updated Contact update date
* @return string header link
*/
public static function getHeaderUrlForId(int $cid, string $size = '', string $updated = '', string $guid = ''):string
public static function getHeaderUrlForId(int $cid, string $size = '', string $updated = '', string $guid = ''): string
{
// We have to fetch the "updated" variable when it wasn't provided
// The parameter can be provided to improve performance
@ -2312,6 +2312,8 @@ class Contact
}
/**
* Updates contact record by provided id and optional network
*
* @param integer $id contact id
* @param string $network Optional network we are probing for
* @return boolean
@ -2335,13 +2337,15 @@ class Contact
}
/**
* Updates contact record by provided id and probed data
*
* @param integer $id contact id
* @param array $ret Probed data
* @return boolean
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
private static function updateFromProbeArray(int $id, array $ret)
private static function updateFromProbeArray(int $id, array $ret): bool
{
/*
Warning: Never ever fetch the public key via Probe::uri and write it into the contacts.
@ -2552,12 +2556,14 @@ class Contact
}
/**
* Updates contact record by provided URL
*
* @param integer $url contact url
* @return integer Contact id
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public static function updateFromProbeByURL($url)
public static function updateFromProbeByURL(string $url): int
{
$id = self::getIdForURL($url);
@ -2578,7 +2584,7 @@ class Contact
* @param string $network Network of that contact
* @return string with protocol
*/
public static function getProtocol($url, $network)
public static function getProtocol(string $url, string $network): string
{
if ($network != Protocol::DFRN) {
return $network;
@ -2945,6 +2951,7 @@ class Contact
* Update the local relationship when a local user loses a follower
*
* @param array $contact User-specific contact (uid != 0) array
* @return void
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/

View file

@ -103,17 +103,27 @@ class FContact
$posts = Post::countPosts(['author-id' => $contact['id'], 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]]);
}
$fields = ['name' => $arr["name"], 'photo' => $arr["photo"],
'request' => $arr["request"], 'nick' => $arr["nick"],
'addr' => strtolower($arr["addr"]), 'guid' => $arr["guid"],
'batch' => $arr["batch"], 'notify' => $arr["notify"],
'poll' => $arr["poll"], 'confirm' => $arr["confirm"],
'alias' => $arr["alias"], 'pubkey' => $arr["pubkey"],
'uri-id' => $uriid, 'interacting_count' => $interacting ?? 0,
'interacted_count' => $interacted ?? 0, 'post_count' => $posts ?? 0,
'updated' => DateTimeFormat::utcNow()];
$fields = [
'name' => $arr['name'],
'photo' => $arr['photo'],
'request' => $arr['request'],
'nick' => $arr['nick'],
'addr' => strtolower($arr['addr']),
'guid' => $arr['guid'],
'batch' => $arr['batch'],
'notify' => $arr['notify'],
'poll' => $arr['poll'],
'confirm' => $arr['confirm'],
'alias' => $arr['alias'],
'pubkey' => $arr['pubkey'],
'uri-id' => $uriid,
'interacting_count' => $interacting ?? 0,
'interacted_count' => $interacted ?? 0,
'post_count' => $posts ?? 0,
'updated' => DateTimeFormat::utcNow(),
];
$condition = ['url' => $arr["url"], 'network' => $arr["network"]];
$condition = ['url' => $arr['url'], 'network' => $arr['network']];
DBA::update('fcontact', $fields, $condition, true);
}
@ -123,7 +133,6 @@ class FContact
* fcontact guid
*
* @param string $fcontact_guid Hexadecimal string guid
*
* @return string|null the contact url or null
* @throws \Exception
*/