Add public keyword to methods
[MAILPOET-2413]
This commit is contained in:
@@ -10,7 +10,7 @@ use MailPoet\Tasks\Sending as SendingTask;
|
||||
|
||||
class AutomaticEmailScheduler {
|
||||
|
||||
function scheduleAutomaticEmail($group, $event, $scheduling_condition = false, $subscriber_id = false, $meta = false) {
|
||||
public function scheduleAutomaticEmail($group, $event, $scheduling_condition = false, $subscriber_id = false, $meta = false) {
|
||||
$newsletters = Scheduler::getNewsletters(Newsletter::TYPE_AUTOMATIC, $group);
|
||||
if (empty($newsletters)) return false;
|
||||
foreach ($newsletters as $newsletter) {
|
||||
@@ -20,7 +20,7 @@ class AutomaticEmailScheduler {
|
||||
}
|
||||
}
|
||||
|
||||
function scheduleOrRescheduleAutomaticEmail($group, $event, $subscriber_id, $meta = false) {
|
||||
public function scheduleOrRescheduleAutomaticEmail($group, $event, $subscriber_id, $meta = false) {
|
||||
$newsletters = Scheduler::getNewsletters(Newsletter::TYPE_AUTOMATIC, $group);
|
||||
if (empty($newsletters)) {
|
||||
return false;
|
||||
@@ -41,7 +41,7 @@ class AutomaticEmailScheduler {
|
||||
}
|
||||
}
|
||||
|
||||
function rescheduleAutomaticEmail($group, $event, $subscriber_id) {
|
||||
public function rescheduleAutomaticEmail($group, $event, $subscriber_id) {
|
||||
$newsletters = Scheduler::getNewsletters(Newsletter::TYPE_AUTOMATIC, $group);
|
||||
if (empty($newsletters)) {
|
||||
return false;
|
||||
@@ -60,7 +60,7 @@ class AutomaticEmailScheduler {
|
||||
}
|
||||
}
|
||||
|
||||
function cancelAutomaticEmail($group, $event, $subscriber_id) {
|
||||
public function cancelAutomaticEmail($group, $event, $subscriber_id) {
|
||||
$newsletters = Scheduler::getNewsletters(Newsletter::TYPE_AUTOMATIC, $group);
|
||||
if (empty($newsletters)) {
|
||||
return false;
|
||||
@@ -81,7 +81,7 @@ class AutomaticEmailScheduler {
|
||||
}
|
||||
}
|
||||
|
||||
function createAutomaticEmailSendingTask($newsletter, $subscriber_id, $meta) {
|
||||
public function createAutomaticEmailSendingTask($newsletter, $subscriber_id, $meta) {
|
||||
$sending_task = SendingTask::create();
|
||||
$sending_task->newsletter_id = $newsletter->id;
|
||||
if ($newsletter->sendTo === 'user' && $subscriber_id) {
|
||||
|
@@ -30,7 +30,7 @@ class PostNotificationScheduler {
|
||||
$this->logger_factory = LoggerFactory::getInstance();
|
||||
}
|
||||
|
||||
function transitionHook($new_status, $old_status, $post) {
|
||||
public function transitionHook($new_status, $old_status, $post) {
|
||||
$this->logger_factory->getLogger(LoggerFactory::TOPIC_POST_NOTIFICATIONS)->addInfo(
|
||||
'transition post notification hook initiated',
|
||||
[
|
||||
@@ -46,7 +46,7 @@ class PostNotificationScheduler {
|
||||
$this->schedulePostNotification($post->ID);
|
||||
}
|
||||
|
||||
function schedulePostNotification($post_id) {
|
||||
public function schedulePostNotification($post_id) {
|
||||
$this->logger_factory->getLogger(LoggerFactory::TOPIC_POST_NOTIFICATIONS)->addInfo(
|
||||
'schedule post notification hook',
|
||||
['post_id' => $post_id]
|
||||
@@ -63,7 +63,7 @@ class PostNotificationScheduler {
|
||||
}
|
||||
}
|
||||
|
||||
function createPostNotificationSendingTask($newsletter) {
|
||||
public function createPostNotificationSendingTask($newsletter) {
|
||||
$existing_notification_history = Newsletter::tableAlias('newsletters')
|
||||
->where('newsletters.parent_id', $newsletter->id)
|
||||
->where('newsletters.type', Newsletter::TYPE_NOTIFICATION_HISTORY)
|
||||
@@ -102,7 +102,7 @@ class PostNotificationScheduler {
|
||||
return $sending_task;
|
||||
}
|
||||
|
||||
function processPostNotificationSchedule($newsletter) {
|
||||
public function processPostNotificationSchedule($newsletter) {
|
||||
$interval_type = $newsletter->intervalType;
|
||||
$hour = (int)$newsletter->timeOfDay / self::SECONDS_IN_HOUR;
|
||||
$week_day = $newsletter->weekDay;
|
||||
|
@@ -8,7 +8,7 @@ use MailPoetVendor\Carbon\Carbon;
|
||||
|
||||
class Scheduler {
|
||||
|
||||
static function getNextRunDate($schedule, $from_timestamp = false) {
|
||||
public static function getNextRunDate($schedule, $from_timestamp = false) {
|
||||
$wp = new WPFunctions();
|
||||
$from_timestamp = ($from_timestamp) ? $from_timestamp : $wp->currentTime('timestamp');
|
||||
try {
|
||||
@@ -21,7 +21,7 @@ class Scheduler {
|
||||
return $next_run_date;
|
||||
}
|
||||
|
||||
static function getPreviousRunDate($schedule, $from_timestamp = false) {
|
||||
public static function getPreviousRunDate($schedule, $from_timestamp = false) {
|
||||
$wp = WPFunctions::get();
|
||||
$from_timestamp = ($from_timestamp) ? $from_timestamp : $wp->currentTime('timestamp');
|
||||
try {
|
||||
@@ -34,7 +34,7 @@ class Scheduler {
|
||||
return $previous_run_date;
|
||||
}
|
||||
|
||||
static function getScheduledTimeWithDelay($after_time_type, $after_time_number) {
|
||||
public static function getScheduledTimeWithDelay($after_time_type, $after_time_number) {
|
||||
$wp = WPFunctions::get();
|
||||
$current_time = Carbon::createFromTimestamp($wp->currentTime('timestamp'));
|
||||
switch ($after_time_type) {
|
||||
@@ -51,7 +51,7 @@ class Scheduler {
|
||||
}
|
||||
}
|
||||
|
||||
static function getNewsletters($type, $group = false) {
|
||||
public static function getNewsletters($type, $group = false) {
|
||||
return Newsletter::getPublished()
|
||||
->filter('filterType', $type, $group)
|
||||
->filter('filterStatus', Newsletter::STATUS_ACTIVE)
|
||||
@@ -59,7 +59,7 @@ class Scheduler {
|
||||
->findMany();
|
||||
}
|
||||
|
||||
static function formatDatetimeString($datetime_string) {
|
||||
public static function formatDatetimeString($datetime_string) {
|
||||
return Carbon::parse($datetime_string)->format('Y-m-d H:i:s');
|
||||
}
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@ class WelcomeScheduler {
|
||||
|
||||
const WORDPRESS_ALL_ROLES = 'mailpoet_all';
|
||||
|
||||
function scheduleSubscriberWelcomeNotification($subscriber_id, $segments) {
|
||||
public function scheduleSubscriberWelcomeNotification($subscriber_id, $segments) {
|
||||
$newsletters = Scheduler::getNewsletters(Newsletter::TYPE_WELCOME);
|
||||
if (empty($newsletters)) return false;
|
||||
$result = [];
|
||||
@@ -24,7 +24,7 @@ class WelcomeScheduler {
|
||||
return $result;
|
||||
}
|
||||
|
||||
function scheduleWPUserWelcomeNotification(
|
||||
public function scheduleWPUserWelcomeNotification(
|
||||
$subscriber_id,
|
||||
$wp_user,
|
||||
$old_user_data = false
|
||||
@@ -52,7 +52,7 @@ class WelcomeScheduler {
|
||||
}
|
||||
}
|
||||
|
||||
function createWelcomeNotificationSendingTask($newsletter, $subscriber_id) {
|
||||
public function createWelcomeNotificationSendingTask($newsletter, $subscriber_id) {
|
||||
$previously_scheduled_notification = SendingQueue::joinWithSubscribers()
|
||||
->where('queues.newsletter_id', $newsletter->id)
|
||||
->where('subscribers.subscriber_id', $subscriber_id)
|
||||
|
Reference in New Issue
Block a user