Add space between foreach and ‘(‘
[MAILPOET-1791]
This commit is contained in:
@@ -131,11 +131,11 @@ class Migration extends SimpleWorker {
|
||||
);
|
||||
|
||||
if(!empty($queues)) {
|
||||
foreach(array_chunk($queues, self::BATCH_SIZE) as $queue_batch) {
|
||||
foreach (array_chunk($queues, self::BATCH_SIZE) as $queue_batch) {
|
||||
// abort if execution limit is reached
|
||||
CronHelper::enforceExecutionLimit($this->timer);
|
||||
|
||||
foreach($queue_batch as $queue) {
|
||||
foreach ($queue_batch as $queue) {
|
||||
// create a new scheduled task of type "sending"
|
||||
$wpdb->query(sprintf(
|
||||
'INSERT IGNORE INTO %1$s (`type`, %2$s) ' .
|
||||
@@ -180,7 +180,7 @@ class Migration extends SimpleWorker {
|
||||
}
|
||||
|
||||
if(!empty($task_ids)) {
|
||||
foreach($task_ids as $task_id) {
|
||||
foreach ($task_ids as $task_id) {
|
||||
// abort if execution limit is reached
|
||||
CronHelper::enforceExecutionLimit($this->timer);
|
||||
|
||||
@@ -215,7 +215,7 @@ class Migration extends SimpleWorker {
|
||||
|
||||
if(!empty($subscribers['to_process'])) {
|
||||
$subscribers_to_migrate = array_slice($subscribers['to_process'], $migrated_unprocessed_count);
|
||||
foreach($subscribers_to_migrate as $sub_id) {
|
||||
foreach ($subscribers_to_migrate as $sub_id) {
|
||||
// abort if execution limit is reached
|
||||
CronHelper::enforceExecutionLimit($this->timer);
|
||||
|
||||
@@ -229,7 +229,7 @@ class Migration extends SimpleWorker {
|
||||
|
||||
if(!empty($subscribers['processed'])) {
|
||||
$subscribers_to_migrate = array_slice($subscribers['processed'], $migrated_processed_count);
|
||||
foreach($subscribers_to_migrate as $sub_id) {
|
||||
foreach ($subscribers_to_migrate as $sub_id) {
|
||||
// abort if execution limit is reached
|
||||
CronHelper::enforceExecutionLimit($this->timer);
|
||||
|
||||
|
@@ -27,7 +27,7 @@ class SendingErrorHandler {
|
||||
}
|
||||
|
||||
private function processSoftError(MailerError $error, SendingTask $sending_task, $prepared_subscribers_ids, $prepared_subscribers) {
|
||||
foreach($error->getSubscriberErrors() as $subscriber_error) {
|
||||
foreach ($error->getSubscriberErrors() as $subscriber_error) {
|
||||
$subscriber_id_index = array_search($subscriber_error->getEmail(), $prepared_subscribers);
|
||||
$message = $subscriber_error->getMessage() ?: $error->getMessage();
|
||||
$sending_task->saveSubscriberError($prepared_subscribers_ids[$subscriber_id_index], $message);
|
||||
|
@@ -45,7 +45,7 @@ class SendingQueue {
|
||||
|
||||
function process() {
|
||||
$this->enforceSendingAndExecutionLimits();
|
||||
foreach(self::getRunningQueues() as $queue) {
|
||||
foreach (self::getRunningQueues() as $queue) {
|
||||
if(!$queue instanceof SendingTask) continue;
|
||||
ScheduledTaskModel::touchAllByIds(array($queue->task_id));
|
||||
|
||||
@@ -71,7 +71,7 @@ class SendingQueue {
|
||||
$newsletter_segments_ids = $this->newsletter_task->getNewsletterSegments($newsletter);
|
||||
// get subscribers
|
||||
$subscriber_batches = new BatchIterator($queue->task_id, $this->batch_size);
|
||||
foreach($subscriber_batches as $subscribers_to_process_ids) {
|
||||
foreach ($subscriber_batches as $subscribers_to_process_ids) {
|
||||
if(!empty($newsletter_segments_ids[0])) {
|
||||
// Check that subscribers are in segments
|
||||
$finder = new SubscribersFinder();
|
||||
@@ -120,7 +120,7 @@ class SendingQueue {
|
||||
$prepared_subscribers_ids = array();
|
||||
$unsubscribe_urls = array();
|
||||
$statistics = array();
|
||||
foreach($subscribers as $subscriber) {
|
||||
foreach ($subscribers as $subscriber) {
|
||||
// render shortcodes and replace subscriber data in tracked links
|
||||
$prepared_newsletters[] =
|
||||
$this->newsletter_task->prepareNewsletterForSending(
|
||||
|
@@ -20,7 +20,7 @@ class Posts {
|
||||
return false;
|
||||
}
|
||||
$newsletter_id = $newsletter->parent_id; // parent post notification
|
||||
foreach($matched_posts_ids as $post_id) {
|
||||
foreach ($matched_posts_ids as $post_id) {
|
||||
$newsletter_post = NewsletterPost::create();
|
||||
$newsletter_post->newsletter_id = $newsletter_id;
|
||||
$newsletter_post->post_id = $post_id;
|
||||
|
Reference in New Issue
Block a user