diff --git a/lib/Cron/Workers/SendingQueue/SendingQueue.php b/lib/Cron/Workers/SendingQueue/SendingQueue.php index 02eae97ebd..b7e494f5ec 100644 --- a/lib/Cron/Workers/SendingQueue/SendingQueue.php +++ b/lib/Cron/Workers/SendingQueue/SendingQueue.php @@ -42,9 +42,11 @@ class SendingQueue { } // get subscribers $queue->subscribers = SubscribersTask::get($queue->subscribers); - foreach(array_chunk($queue->subscribers['to_process'], self::BATCH_SIZE) - as $subscribers_to_process_ids - ) { + $subscriber_batches = array_chunk( + $queue->subscribers['to_process'], + self::BATCH_SIZE + ); + foreach($subscriber_batches as $subscribers_to_process_ids) { $found_subscribers = SubscriberModel::whereIn('id', $subscribers_to_process_ids) ->findArray(); $found_subscribers_ids = Helpers::arrayColumn($found_subscribers, 'id'); diff --git a/lib/Models/Subscriber.php b/lib/Models/Subscriber.php index 99bb80962a..98a1eef541 100644 --- a/lib/Models/Subscriber.php +++ b/lib/Models/Subscriber.php @@ -666,8 +666,8 @@ class Subscriber extends Model { '(' . implode(', ', $columns) . ') ' . 'VALUES ' . rtrim( str_repeat( - '(' . rtrim(str_repeat('?,', count($columns)), ',') . ')' . ', ' - , count($values) + '(' . rtrim(str_repeat('?,', count($columns)), ',') . ')' . ', ', + count($values) ), ', ' ), diff --git a/lib/Models/SubscriberCustomField.php b/lib/Models/SubscriberCustomField.php index 8d5eb70729..c036b765f1 100644 --- a/lib/Models/SubscriberCustomField.php +++ b/lib/Models/SubscriberCustomField.php @@ -58,8 +58,8 @@ class SubscriberCustomField extends Model { '(custom_field_id, subscriber_id, value) ' . 'VALUES ' . rtrim( str_repeat( - '(?, ?, ?)' . ', ' - , count($values) + '(?, ?, ?)' . ', ', + count($values) ), ', ' ), Helpers::flattenArray($values)