Fix spacing between control structure and opening parenthesis
This commit is contained in:
@ -25,7 +25,7 @@ class Permissions {
|
||||
'mailpoet_statistics'
|
||||
);
|
||||
|
||||
foreach($roles as $role_key){
|
||||
foreach($roles as $role_key) {
|
||||
// get role based on role key
|
||||
$role = get_role($role_key);
|
||||
|
||||
@ -40,4 +40,4 @@ class Permissions {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,17 +32,16 @@ class Supervisor {
|
||||
// force-running the daemon, return its status and do nothing
|
||||
if($elapsed_time < CronHelper::DAEMON_EXECUTION_TIMEOUT && !$this->force_run) {
|
||||
return $this->formatDaemonStatusMessage($daemon['status']);
|
||||
}
|
||||
// if it's been less than 40 seconds since last execution, we are
|
||||
// force-running the daemon and it's either being started or stopped,
|
||||
// return its status and do nothing
|
||||
elseif($elapsed_time < CronHelper::DAEMON_EXECUTION_TIMEOUT &&
|
||||
} elseif($elapsed_time < CronHelper::DAEMON_EXECUTION_TIMEOUT &&
|
||||
$this->force_run &&
|
||||
in_array($daemon['status'], array(
|
||||
Daemon::STATUS_STOPPING,
|
||||
Daemon::STATUS_STARTING
|
||||
))
|
||||
) {
|
||||
// if it's been less than 40 seconds since last execution, we are
|
||||
// force-running the daemon and it's either being started or stopped,
|
||||
// return its status and do nothing
|
||||
return $this->formatDaemonStatusMessage($daemon['status']);
|
||||
}
|
||||
// re-create (restart) daemon
|
||||
@ -90,4 +89,4 @@ class Supervisor {
|
||||
}
|
||||
return $formattedResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ class Scheduler {
|
||||
return;
|
||||
}
|
||||
// schedule new queue if the post notification is not destined for immediate delivery
|
||||
if ($newsletter->intervalType !== NewsletterScheduler::INTERVAL_IMMEDIATELY) {
|
||||
if($newsletter->intervalType !== NewsletterScheduler::INTERVAL_IMMEDIATELY) {
|
||||
$new_queue = SendingQueue::create();
|
||||
$new_queue->newsletter_id = $newsletter->id;
|
||||
$new_queue->status = NewsletterScheduler::STATUS_SCHEDULED;
|
||||
@ -174,4 +174,4 @@ class Scheduler {
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class Renderer {
|
||||
|
||||
static function renderBlocks($blocks = array()) {
|
||||
$html = '';
|
||||
foreach ($blocks as $key => $block) {
|
||||
foreach($blocks as $key => $block) {
|
||||
$html .= static::renderBlock($block)."\n";
|
||||
}
|
||||
|
||||
@ -93,4 +93,4 @@ class Renderer {
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ class Widget extends \WP_Widget {
|
||||
<p>
|
||||
<select class="widefat" id="<?php echo $this->get_field_id('form') ?>" name="<?php echo $this->get_field_name('form'); ?>">
|
||||
<?php
|
||||
foreach ($forms as $form) {
|
||||
foreach($forms as $form) {
|
||||
$is_selected = ($selected_form === (int)$form['id']) ? 'selected="selected"' : '';
|
||||
?>
|
||||
<option value="<?php echo (int)$form['id']; ?>" <?php echo $is_selected; ?>><?php echo esc_html($form['name']); ?></option>
|
||||
@ -172,4 +172,4 @@ class Widget extends \WP_Widget {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ class Newsletter extends Model {
|
||||
static function filterWithOptions($orm) {
|
||||
$orm = $orm->select(MP_NEWSLETTERS_TABLE.'.*');
|
||||
$optionFields = NewsletterOptionField::findArray();
|
||||
foreach ($optionFields as $optionField) {
|
||||
foreach($optionFields as $optionField) {
|
||||
$orm = $orm->select_expr(
|
||||
'IFNULL(GROUP_CONCAT(CASE WHEN ' .
|
||||
MP_NEWSLETTER_OPTION_FIELDS_TABLE . '.id=' . $optionField['id'] . ' THEN ' .
|
||||
@ -515,4 +515,4 @@ class Newsletter extends Model {
|
||||
->whereIn('options.value', $segments)
|
||||
->findMany();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ class Subscriber extends Model {
|
||||
static function filterWithCustomFields($orm) {
|
||||
$orm = $orm->select(MP_SUBSCRIBERS_TABLE.'.*');
|
||||
$customFields = CustomField::findArray();
|
||||
foreach ($customFields as $customField) {
|
||||
foreach($customFields as $customField) {
|
||||
$orm = $orm->select_expr(
|
||||
'IFNULL(GROUP_CONCAT(CASE WHEN ' .
|
||||
MP_CUSTOM_FIELDS_TABLE . '.id=' . $customField['id'] . ' THEN ' .
|
||||
@ -335,7 +335,7 @@ class Subscriber extends Model {
|
||||
static function filterWithCustomFieldsForExport($orm) {
|
||||
$orm = $orm->select(MP_SUBSCRIBERS_TABLE.'.*');
|
||||
$customFields = CustomField::findArray();
|
||||
foreach ($customFields as $customField) {
|
||||
foreach($customFields as $customField) {
|
||||
$orm = $orm->selectExpr(
|
||||
'MAX(CASE WHEN ' .
|
||||
MP_CUSTOM_FIELDS_TABLE . '.id=' . $customField['id'] . ' THEN ' .
|
||||
|
@ -7,7 +7,7 @@ class MetaInformationManager {
|
||||
|
||||
function appendMetaInformation($content, $post, $args) {
|
||||
// Append author and categories above and below contents
|
||||
foreach (array('above', 'below') as $position) {
|
||||
foreach(array('above', 'below') as $position) {
|
||||
$position_field = $position . 'Text';
|
||||
$text = array();
|
||||
|
||||
|
@ -16,7 +16,7 @@ class PostListTransformer {
|
||||
$results = array();
|
||||
$use_divider = $this->args['showDivider'] === 'true';
|
||||
|
||||
foreach ($posts as $index => $post) {
|
||||
foreach($posts as $index => $post) {
|
||||
if($use_divider && $index > 0) {
|
||||
$results[] = $this->args['divider'];
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class StructureTransformer {
|
||||
* and inserts tags before top ancestor
|
||||
*/
|
||||
private function hoistImagesToRoot($root) {
|
||||
foreach ($root->query('img') as $item) {
|
||||
foreach($root->query('img') as $item) {
|
||||
$top_ancestor = $this->findTopAncestor($item);
|
||||
$offset = $top_ancestor->index();
|
||||
|
||||
@ -34,7 +34,7 @@ class StructureTransformer {
|
||||
}
|
||||
|
||||
private static function findTopAncestor($item) {
|
||||
while ($item->parent->parent !== null) {
|
||||
while($item->parent->parent !== null) {
|
||||
$item = $item->parent;
|
||||
}
|
||||
return $item;
|
||||
@ -86,7 +86,7 @@ class StructureTransformer {
|
||||
private function mergeNeighboringBlocks($structure) {
|
||||
$updated_structure = array();
|
||||
$text_accumulator = '';
|
||||
foreach ($structure as $item) {
|
||||
foreach($structure as $item) {
|
||||
if($item['type'] === 'text') {
|
||||
$text_accumulator .= $item['text'];
|
||||
}
|
||||
|
@ -23,8 +23,7 @@ class Renderer {
|
||||
// vertical orientation denotes column container
|
||||
if($block['type'] === 'container' && $block['orientation'] === 'vertical') {
|
||||
$column_content[] = $rendered_block_element;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$block_content .= $rendered_block_element;
|
||||
}
|
||||
}, $data['blocks']);
|
||||
|
@ -149,7 +149,7 @@ class Forms {
|
||||
// or if it's selected by the admin
|
||||
$has_segment_selection = false;
|
||||
|
||||
foreach ($body as $i => $block) {
|
||||
foreach($body as $i => $block) {
|
||||
if($block['type'] === 'segment') {
|
||||
$has_segment_selection = true;
|
||||
if(!empty($block['params']['values'])) {
|
||||
|
@ -86,7 +86,9 @@ class Router {
|
||||
}
|
||||
|
||||
function checkPermissions() {
|
||||
if(!current_user_can('manage_options')) { die(); }
|
||||
if(!current_user_can('manage_options')) {
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
function verifyToken() {
|
||||
|
@ -23,7 +23,7 @@ class MailChimp {
|
||||
return $this->processError('connection');
|
||||
} else {
|
||||
$response = '';
|
||||
while (!feof($connection)) {
|
||||
while(!feof($connection)) {
|
||||
$buffer = fgets($connection, 4096);
|
||||
if(trim($buffer) !== '') {
|
||||
$response .= $buffer;
|
||||
@ -38,7 +38,7 @@ class MailChimp {
|
||||
return $this->processError('API');
|
||||
}
|
||||
|
||||
foreach ($response->data as $list) {
|
||||
foreach($response->data as $list) {
|
||||
$lists[] = array(
|
||||
'id' => $list->id,
|
||||
'name' => $list->name
|
||||
@ -61,7 +61,7 @@ class MailChimp {
|
||||
}
|
||||
|
||||
$bytes_fetched = 0;
|
||||
foreach ($lists as $list) {
|
||||
foreach($lists as $list) {
|
||||
$url = sprintf($this->export_url, $this->data_center, $this->api_key, $list);
|
||||
$connection = @fopen($url, 'r');
|
||||
if(!$connection) {
|
||||
@ -69,7 +69,7 @@ class MailChimp {
|
||||
} else {
|
||||
$i = 0;
|
||||
$header = array();
|
||||
while (!feof($connection)) {
|
||||
while(!feof($connection)) {
|
||||
$buffer = fgets($connection, 4096);
|
||||
if(trim($buffer) !== '') {
|
||||
$obj = json_decode($buffer);
|
||||
@ -155,4 +155,4 @@ class MailChimp {
|
||||
'errors' => array($errorMessage)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ class Pages {
|
||||
}
|
||||
$subscribed_segment_ids = array();
|
||||
if(!empty($this->subscriber->subscriptions)) {
|
||||
foreach ($this->subscriber->subscriptions as $subscription) {
|
||||
foreach($this->subscriber->subscriptions as $subscription) {
|
||||
if($subscription['status'] === Subscriber::STATUS_SUBSCRIBED) {
|
||||
$subscribed_segment_ids[] = $subscription['segment_id'];
|
||||
}
|
||||
@ -373,4 +373,4 @@ class Pages {
|
||||
$this->subscriber
|
||||
).'">'.$text.'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class DateTime {
|
||||
$formatted_time = $start_time;
|
||||
$timestamp = strtotime($formatted_time);
|
||||
|
||||
for ($step = 0; $step < $total_steps; $step += 1) {
|
||||
for($step = 0; $step < $total_steps; $step += 1) {
|
||||
$formatted_time = $this->formatTime($timestamp, self::DEFAULT_TIME_FORMAT);
|
||||
$label_time = $this->formatTime($timestamp);
|
||||
$steps[$formatted_time] = $label_time;
|
||||
|
Reference in New Issue
Block a user