Fix doc blocks and return value type
This commit is contained in:
parent
504945f9df
commit
ce177f22c8
6 changed files with 15 additions and 16 deletions
|
@ -528,7 +528,7 @@ function api_unique_id_to_nurl($id)
|
||||||
*
|
*
|
||||||
* @param App $a App
|
* @param App $a App
|
||||||
* @param int|string $contact_id Contact ID or URL
|
* @param int|string $contact_id Contact ID or URL
|
||||||
* @return array
|
* @return array|bool
|
||||||
* @throws BadRequestException
|
* @throws BadRequestException
|
||||||
* @throws ImagickException
|
* @throws ImagickException
|
||||||
* @throws InternalServerErrorException
|
* @throws InternalServerErrorException
|
||||||
|
|
|
@ -1447,7 +1447,7 @@ function sort_thr_created_rev(array $a, array $b)
|
||||||
*
|
*
|
||||||
* @param array $a
|
* @param array $a
|
||||||
* @param array $b
|
* @param array $b
|
||||||
* @return int|lt
|
* @return int
|
||||||
*/
|
*/
|
||||||
function sort_thr_commented(array $a, array $b)
|
function sort_thr_commented(array $a, array $b)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,7 +25,7 @@ use Friendica\Util\Strings;
|
||||||
* link, subject, body, to_name, to_email, source_name,
|
* link, subject, body, to_name, to_email, source_name,
|
||||||
* source_link, activity, preamble, notify_flags,
|
* source_link, activity, preamble, notify_flags,
|
||||||
* language, show_in_notification_page
|
* language, show_in_notification_page
|
||||||
* @return bool|object
|
* @return bool
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
function notification($params)
|
function notification($params)
|
||||||
|
@ -43,7 +43,7 @@ function notification($params)
|
||||||
|
|
||||||
if (!DBA::isResult($user)) {
|
if (!DBA::isResult($user)) {
|
||||||
Logger::log('Unknown user ' . $params['uid']);
|
Logger::log('Unknown user ' . $params['uid']);
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$params['notify_flags'] = defaults($params, 'notify_flags', $user['notify-flags']);
|
$params['notify_flags'] = defaults($params, 'notify_flags', $user['notify-flags']);
|
||||||
|
@ -79,7 +79,7 @@ function notification($params)
|
||||||
|
|
||||||
// There is no need to create notifications for forum accounts
|
// There is no need to create notifications for forum accounts
|
||||||
if (!DBA::isResult($user) || in_array($user["page-flags"], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])) {
|
if (!DBA::isResult($user) || in_array($user["page-flags"], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
$nickname = $user["nickname"];
|
$nickname = $user["nickname"];
|
||||||
} else {
|
} else {
|
||||||
|
@ -146,7 +146,7 @@ function notification($params)
|
||||||
if (DBA::isResult($thread) && $thread['ignored']) {
|
if (DBA::isResult($thread) && $thread['ignored']) {
|
||||||
Logger::log('Thread ' . $parent_id . ' will be ignored', Logger::DEBUG);
|
Logger::log('Thread ' . $parent_id . ' will be ignored', Logger::DEBUG);
|
||||||
L10n::popLang();
|
L10n::popLang();
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if there was already a tag notify or comment notify for this post.
|
// Check to see if there was already a tag notify or comment notify for this post.
|
||||||
|
@ -155,7 +155,7 @@ function notification($params)
|
||||||
'link' => $params['link'], 'uid' => $params['uid']];
|
'link' => $params['link'], 'uid' => $params['uid']];
|
||||||
if (DBA::exists('notify', $condition)) {
|
if (DBA::exists('notify', $condition)) {
|
||||||
L10n::popLang();
|
L10n::popLang();
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it's a post figure out who's post it is.
|
// if it's a post figure out who's post it is.
|
||||||
|
@ -522,7 +522,7 @@ function notification($params)
|
||||||
|
|
||||||
if ($datarray['abort']) {
|
if ($datarray['abort']) {
|
||||||
L10n::popLang();
|
L10n::popLang();
|
||||||
return False;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create notification entry in DB
|
// create notification entry in DB
|
||||||
|
@ -671,8 +671,7 @@ function notification($params)
|
||||||
|
|
||||||
L10n::popLang();
|
L10n::popLang();
|
||||||
// use the Emailer class to send the message
|
// use the Emailer class to send the message
|
||||||
return Emailer::send(
|
return Emailer::send([
|
||||||
[
|
|
||||||
'uid' => $params['uid'],
|
'uid' => $params['uid'],
|
||||||
'fromName' => $sender_name,
|
'fromName' => $sender_name,
|
||||||
'fromEmail' => $sender_email,
|
'fromEmail' => $sender_email,
|
||||||
|
@ -681,8 +680,8 @@ function notification($params)
|
||||||
'messageSubject' => $datarray['subject'],
|
'messageSubject' => $datarray['subject'],
|
||||||
'htmlVersion' => $email_html_body,
|
'htmlVersion' => $email_html_body,
|
||||||
'textVersion' => $email_text_body,
|
'textVersion' => $email_text_body,
|
||||||
'additionalMailHeader' => $datarray['headers']]
|
'additionalMailHeader' => $datarray['headers']
|
||||||
);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
L10n::popLang();
|
L10n::popLang();
|
||||||
|
@ -778,7 +777,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
|
||||||
$condition = ['id' => $itemid, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]];
|
$condition = ['id' => $itemid, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]];
|
||||||
$item = Item::selectFirst($fields, $condition);
|
$item = Item::selectFirst($fields, $condition);
|
||||||
if (!DBA::isResult($item) || in_array($item['author-id'], $contacts)) {
|
if (!DBA::isResult($item) || in_array($item['author-id'], $contacts)) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate the notification array
|
// Generate the notification array
|
||||||
|
|
|
@ -235,7 +235,7 @@ function get_cats_and_terms($item)
|
||||||
/**
|
/**
|
||||||
* return number of bytes in size (K, M, G)
|
* return number of bytes in size (K, M, G)
|
||||||
* @param string $size_str
|
* @param string $size_str
|
||||||
* @return number
|
* @return int
|
||||||
*/
|
*/
|
||||||
function return_bytes($size_str) {
|
function return_bytes($size_str) {
|
||||||
switch (substr ($size_str, -1)) {
|
switch (substr ($size_str, -1)) {
|
||||||
|
|
|
@ -170,7 +170,7 @@ class Thread extends BaseObject
|
||||||
*
|
*
|
||||||
* We should find a way to avoid using those arguments (at least most of them)
|
* We should find a way to avoid using those arguments (at least most of them)
|
||||||
*
|
*
|
||||||
* @param object $conv_responses data
|
* @param array $conv_responses data
|
||||||
*
|
*
|
||||||
* @return mixed The data requested on success
|
* @return mixed The data requested on success
|
||||||
* false on failure
|
* false on failure
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Emailer
|
||||||
* additionalMailHeader additions to the SMTP mail header
|
* additionalMailHeader additions to the SMTP mail header
|
||||||
* optional uid user id of the destination user
|
* optional uid user id of the destination user
|
||||||
*
|
*
|
||||||
* @return object
|
* @return bool
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function send($params)
|
public static function send($params)
|
||||||
|
|
Loading…
Reference in a new issue