*
* @return integer item id
*/
- public static function fetchByLink($uri, $uid = 0)
+ public static function fetchByLink(string $uri, int $uid = 0)
{
$item_id = self::searchByLink($uri, $uid);
if (!empty($item_id)) {
*
* @return array item array with data from the original item
*/
- public static function addShareDataFromOriginal($item)
+ public static function addShareDataFromOriginal(array $item)
{
$shared = self::getShareArray($item);
if (empty($shared)) {
}
// Otherwhise try to find (and possibly fetch) the item via the link. This should work for Diaspora and ActivityPub posts
- $id = self::fetchByLink($shared['link'], $uid);
+ $id = self::fetchByLink($shared['link'] ?? '', $uid);
if (empty($id)) {
- Logger::info('Original item not found', ['url' => $shared['link'], 'callstack' => System::callstack()]);
+ Logger::info('Original item not found', ['url' => $shared['link'] ?? '', 'callstack' => System::callstack()]);
return $item;
}
* @return array
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function fetchContent($url, $uid = 0)
+ public static function fetchContent(string $url, int $uid = 0)
{
if (!empty($uid)) {
return HTTPSignature::fetch($url, $uid);
* @return string fetched message URL
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function fetchMissingActivity($url, $child = [])
+ public static function fetchMissingActivity(string $url, array $child = [])
{
if (!empty($child['receiver'])) {
$uid = ActivityPub\Receiver::getFirstUserFromReceivers($child['receiver']);