[REFACTOR] Added explicit return type to all instances of QueueHandler::handle
This commit is contained in:
parent
aaabf82eff
commit
0030fe3aeb
@ -51,7 +51,7 @@ class AccountMover extends QueueHandler
|
|||||||
return 'acctmove';
|
return 'acctmove';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($object)
|
function handle($object) : bool
|
||||||
{
|
{
|
||||||
list($user, $remote, $password) = $object;
|
list($user, $remote, $password) = $object;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class ActivityImporter extends QueueHandler
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
list($user, $author, $activity, $trusted) = $data;
|
list($user, $author, $activity, $trusted) = $data;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class ActivityMover extends QueueHandler
|
|||||||
return 'actmove';
|
return 'actmove';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
list ($act, $sink, $userURI, $remoteURI) = $data;
|
list ($act, $sink, $userURI, $remoteURI) = $data;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class DelUserQueueHandler extends QueueHandler
|
|||||||
return 'deluser';
|
return 'deluser';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle($user)
|
public function handle($user) : bool
|
||||||
{
|
{
|
||||||
if (!($user instanceof User)) {
|
if (!($user instanceof User)) {
|
||||||
common_log(LOG_ERR, "Got a bogus user, not deleting");
|
common_log(LOG_ERR, "Got a bogus user, not deleting");
|
||||||
|
@ -61,7 +61,7 @@ class DistribQueueHandler
|
|||||||
* @param Notice $notice
|
* @param Notice $notice
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
public function handle(Notice $notice)
|
public function handle(Notice $notice) : bool
|
||||||
{
|
{
|
||||||
// We have to manually add attentions to non-profile subs and non-mentions
|
// We have to manually add attentions to non-profile subs and non-mentions
|
||||||
$ptAtts = $notice->getAttentionsFromProfileTags();
|
$ptAtts = $notice->getAttentionsFromProfileTags();
|
||||||
|
@ -59,7 +59,7 @@ class FeedImporter extends QueueHandler
|
|||||||
return 'feedimp';
|
return 'feedimp';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
list($user, $xml, $trusted) = $data;
|
list($user, $xml, $trusted) = $data;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class ImQueueHandler extends QueueHandler
|
|||||||
* @param Notice $notice
|
* @param Notice $notice
|
||||||
* @return boolean success
|
* @return boolean success
|
||||||
*/
|
*/
|
||||||
function handle($notice): bool
|
function handle($notice) : bool
|
||||||
{
|
{
|
||||||
if (!($notice instanceof Notice)) {
|
if (!($notice instanceof Notice)) {
|
||||||
common_log(LOG_ERR, "Got a bogus notice, not broadcasting");
|
common_log(LOG_ERR, "Got a bogus notice, not broadcasting");
|
||||||
|
@ -35,7 +35,7 @@ class ImReceiverQueueHandler extends QueueHandler
|
|||||||
* @param object $data
|
* @param object $data
|
||||||
* @return boolean success
|
* @return boolean success
|
||||||
*/
|
*/
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
return $this->plugin->receiveRawMessage($data);
|
return $this->plugin->receiveRawMessage($data);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class ImSenderQueueHandler extends QueueHandler
|
|||||||
* @param object $data
|
* @param object $data
|
||||||
* @return boolean success
|
* @return boolean success
|
||||||
*/
|
*/
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
return $this->plugin->imManager->send_raw_message($data);
|
return $this->plugin->imManager->send_raw_message($data);
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ class PingQueueHandler extends QueueHandler {
|
|||||||
return 'ping';
|
return 'ping';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($notice): bool
|
function handle($notice) : bool
|
||||||
{
|
{
|
||||||
if (!($notice instanceof Notice)) {
|
if (!($notice instanceof Notice)) {
|
||||||
common_log(LOG_ERR, "Got a bogus notice, not broadcasting");
|
common_log(LOG_ERR, "Got a bogus notice, not broadcasting");
|
||||||
|
@ -40,7 +40,7 @@ class PluginQueueHandler extends QueueHandler
|
|||||||
return 'plugin';
|
return 'plugin';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($notice): bool
|
function handle($notice) : bool
|
||||||
{
|
{
|
||||||
if (!($notice instanceof Notice)) {
|
if (!($notice instanceof Notice)) {
|
||||||
common_log(LOG_ERR, "Got a bogus notice, not broadcasting");
|
common_log(LOG_ERR, "Got a bogus notice, not broadcasting");
|
||||||
|
@ -46,7 +46,7 @@ class QueueHandler
|
|||||||
* @param mixed $object
|
* @param mixed $object
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
function handle($object): bool
|
function handle($object) : bool
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ class SmsQueueHandler extends QueueHandler
|
|||||||
return 'sms';
|
return 'sms';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($notice): bool
|
function handle($notice) : bool
|
||||||
{
|
{
|
||||||
if (!($notice instanceof Notice)) {
|
if (!($notice instanceof Notice)) {
|
||||||
common_log(LOG_ERR, "Got a bogus notice, not broadcasting");
|
common_log(LOG_ERR, "Got a bogus notice, not broadcasting");
|
||||||
|
@ -70,7 +70,7 @@ class DeliciousBackupImporter extends QueueHandler
|
|||||||
*
|
*
|
||||||
* @return boolean success value
|
* @return boolean success value
|
||||||
*/
|
*/
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
list($user, $body) = $data;
|
list($user, $body) = $data;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ class DeliciousBookmarkImporter extends QueueHandler
|
|||||||
*
|
*
|
||||||
* @return boolean success value
|
* @return boolean success value
|
||||||
*/
|
*/
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
$profile = Profile::getKV('id', $data['profile_id']);
|
$profile = Profile::getKV('id', $data['profile_id']);
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ class SiteConfirmReminderHandler extends QueueHandler
|
|||||||
* @param array $remitem type of reminder to send and any special options
|
* @param array $remitem type of reminder to send and any special options
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
function handle($remitem)
|
function handle($remitem) : bool
|
||||||
{
|
{
|
||||||
list($type, $opts) = $remitem;
|
list($type, $opts) = $remitem;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ class UserReminderHandler extends QueueHandler {
|
|||||||
* @param Confirm_address $confirm the confirmation email/code
|
* @param Confirm_address $confirm the confirmation email/code
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
function handle($confirm) {
|
function handle($confirm) : bool {
|
||||||
return $this->sendNextReminder($confirm);
|
return $this->sendNextReminder($confirm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ class SiteEmailSummaryHandler extends QueueHandler
|
|||||||
* @param mixed $object
|
* @param mixed $object
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
function handle($object)
|
function handle($object) : bool
|
||||||
{
|
{
|
||||||
$qm = QueueManager::get();
|
$qm = QueueManager::get();
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ class UserEmailSummaryHandler extends QueueHandler
|
|||||||
* @param mixed $object
|
* @param mixed $object
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
function handle($user_id)
|
function handle($user_id) : bool
|
||||||
{
|
{
|
||||||
// Skip if they've asked not to get summaries
|
// Skip if they've asked not to get summaries
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ class FeedPollQueueHandler extends QueueHandler
|
|||||||
return FeedPoll::QUEUE_CHECK;
|
return FeedPoll::QUEUE_CHECK;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle($item)
|
public function handle($item) : bool
|
||||||
{
|
{
|
||||||
$feedsub = FeedSub::getKV('id', $item['id']);
|
$feedsub = FeedSub::getKV('id', $item['id']);
|
||||||
if (!$feedsub instanceof FeedSub) {
|
if (!$feedsub instanceof FeedSub) {
|
||||||
|
@ -33,7 +33,7 @@ class HubConfQueueHandler extends QueueHandler
|
|||||||
return 'hubconf';
|
return 'hubconf';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
$sub = $data['sub'];
|
$sub = $data['sub'];
|
||||||
$mode = $data['mode'];
|
$mode = $data['mode'];
|
||||||
|
@ -31,7 +31,7 @@ class HubOutQueueHandler extends QueueHandler
|
|||||||
return 'hubout';
|
return 'hubout';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
assert(array_key_exists('atom', $data));
|
assert(array_key_exists('atom', $data));
|
||||||
assert(is_string($data['atom']));
|
assert(is_string($data['atom']));
|
||||||
|
@ -43,7 +43,7 @@ class HubPrepQueueHandler extends QueueHandler
|
|||||||
return 'hubprep';
|
return 'hubprep';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
$topic = $data['topic'];
|
$topic = $data['topic'];
|
||||||
$atom = $data['atom'];
|
$atom = $data['atom'];
|
||||||
|
@ -44,7 +44,7 @@ class OStatusQueueHandler extends QueueHandler
|
|||||||
return 'ostatus';
|
return 'ostatus';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($notice): bool
|
function handle($notice) : bool
|
||||||
{
|
{
|
||||||
if (!($notice instanceof Notice)) {
|
if (!($notice instanceof Notice)) {
|
||||||
common_log(LOG_ERR, "Got a bogus notice, not distributing");
|
common_log(LOG_ERR, "Got a bogus notice, not distributing");
|
||||||
|
@ -31,7 +31,7 @@ class PushInQueueHandler extends QueueHandler
|
|||||||
return 'pushin';
|
return 'pushin';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($data): bool
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
if (!is_array($data)) {
|
if (!is_array($data)) {
|
||||||
common_log(LOG_ERR, "Got bogus data, not processing");
|
common_log(LOG_ERR, "Got bogus data, not processing");
|
||||||
|
@ -30,7 +30,7 @@ class PushRenewQueueHandler extends QueueHandler
|
|||||||
return 'pushrenew';
|
return 'pushrenew';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
$feedsub_id = $data['feedsub_id'];
|
$feedsub_id = $data['feedsub_id'];
|
||||||
$feedsub = FeedSub::getKV('id', $feedsub_id);
|
$feedsub = FeedSub::getKV('id', $feedsub_id);
|
||||||
|
@ -33,7 +33,7 @@ class SalmonQueueHandler extends QueueHandler
|
|||||||
return 'salmon';
|
return 'salmon';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
assert(is_array($data));
|
assert(is_array($data));
|
||||||
assert(is_string($data['salmonuri']));
|
assert(is_string($data['salmonuri']));
|
||||||
|
@ -52,7 +52,7 @@ class OfflineBackupQueueHandler extends QueueHandler
|
|||||||
return 'backoff';
|
return 'backoff';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($object)
|
function handle($object) : bool
|
||||||
{
|
{
|
||||||
$userId = $object;
|
$userId = $object;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ class RSSCloudQueueHandler extends QueueHandler
|
|||||||
return 'rsscloud';
|
return 'rsscloud';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($notice): bool
|
function handle($notice) : bool
|
||||||
{
|
{
|
||||||
if (!($notice instanceof Notice)) {
|
if (!($notice instanceof Notice)) {
|
||||||
common_log(LOG_ERR, "Got a bogus notice, not using");
|
common_log(LOG_ERR, "Got a bogus notice, not using");
|
||||||
|
@ -47,7 +47,7 @@ class SubMirrorPlugin extends Plugin
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($notice)
|
function handle($notice) : bool
|
||||||
{
|
{
|
||||||
// Is anybody mirroring?
|
// Is anybody mirroring?
|
||||||
$mirror = new SubMirror();
|
$mirror = new SubMirror();
|
||||||
|
@ -32,7 +32,7 @@ class MirrorQueueHandler extends QueueHandler
|
|||||||
return 'mirror';
|
return 'mirror';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($notice): bool
|
function handle($notice) : bool
|
||||||
{
|
{
|
||||||
if (!($notice instanceof Notice)) {
|
if (!($notice instanceof Notice)) {
|
||||||
common_log(LOG_ERR, "Got a bogus notice, not mirroring");
|
common_log(LOG_ERR, "Got a bogus notice, not mirroring");
|
||||||
|
@ -40,7 +40,7 @@ class TweetInQueueHandler extends QueueHandler
|
|||||||
return 'tweetin';
|
return 'tweetin';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
// JSON object with Twitter data
|
// JSON object with Twitter data
|
||||||
$status = $data['status'];
|
$status = $data['status'];
|
||||||
|
@ -28,7 +28,7 @@ class TwitterQueueHandler extends QueueHandler
|
|||||||
return 'twitter';
|
return 'twitter';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($notice): bool
|
function handle($notice) : bool
|
||||||
{
|
{
|
||||||
if (!($notice instanceof Notice)) {
|
if (!($notice instanceof Notice)) {
|
||||||
common_log(LOG_ERR, "Got a bogus notice, not broadcasting");
|
common_log(LOG_ERR, "Got a bogus notice, not broadcasting");
|
||||||
|
@ -40,7 +40,7 @@ class TweetCtlQueueHandler extends QueueHandler
|
|||||||
return 'tweetctl';
|
return 'tweetctl';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($data)
|
function handle($data) : bool
|
||||||
{
|
{
|
||||||
// A user has activated or deactivated their Twitter bridge
|
// A user has activated or deactivated their Twitter bridge
|
||||||
// import status.
|
// import status.
|
||||||
|
Loading…
Reference in New Issue
Block a user