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