Add space between if and ‘(‘
[MAILPOET-1791]
This commit is contained in:
@ -46,7 +46,7 @@ class DefaultSubscribersGetter extends SubscribersGetter {
|
||||
)
|
||||
->groupBy(Segment::$_table . '.id');
|
||||
|
||||
if($this->get_subscribers_without_segment !== false) {
|
||||
if ($this->get_subscribers_without_segment !== false) {
|
||||
// if there are subscribers who do not belong to any segment, use
|
||||
// a CASE function to group them under "Not In Segment"
|
||||
$subscribers = $subscribers
|
||||
@ -76,4 +76,4 @@ class DefaultSubscribersGetter extends SubscribersGetter {
|
||||
return $subscribers;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ class DynamicSubscribersGetter extends SubscribersGetter {
|
||||
|
||||
function __construct($segments_ids, $batch_size, WPFunctions $wp = null) {
|
||||
parent::__construct($segments_ids, $batch_size);
|
||||
if($wp == null) {
|
||||
if ($wp == null) {
|
||||
$wp = new WPFunctions;
|
||||
}
|
||||
$this->wp = $wp;
|
||||
@ -36,7 +36,7 @@ class DynamicSubscribersGetter extends SubscribersGetter {
|
||||
$segment_id
|
||||
);
|
||||
|
||||
if(!is_array($filters) || empty($filters)) {
|
||||
if (!is_array($filters) || empty($filters)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
@ -57,13 +57,13 @@ class DynamicSubscribersGetter extends SubscribersGetter {
|
||||
}
|
||||
|
||||
public function get() {
|
||||
if($this->segment_index >= count($this->segments_ids)) {
|
||||
if ($this->segment_index >= count($this->segments_ids)) {
|
||||
$this->finished = true;
|
||||
}
|
||||
|
||||
$subscribers = parent::get();
|
||||
|
||||
if($subscribers !== false && count($subscribers) < $this->batch_size) {
|
||||
if ($subscribers !== false && count($subscribers) < $this->batch_size) {
|
||||
$this->segment_index ++;
|
||||
$this->offset = 0;
|
||||
$this->finished = false;
|
||||
|
@ -23,7 +23,7 @@ class Export {
|
||||
public $dynamic_subscribers_getter;
|
||||
|
||||
public function __construct($data) {
|
||||
if(strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
|
||||
if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
|
||||
set_time_limit(0);
|
||||
}
|
||||
|
||||
@ -52,10 +52,10 @@ class Export {
|
||||
function process() {
|
||||
$this->default_subscribers_getter->reset();
|
||||
try {
|
||||
if(is_writable($this->export_path) === false) {
|
||||
if (is_writable($this->export_path) === false) {
|
||||
throw new \Exception(__('The export file could not be saved on the server.', 'mailpoet'));
|
||||
}
|
||||
if(!extension_loaded('zip')) {
|
||||
if (!extension_loaded('zip')) {
|
||||
throw new \Exception(__('Export requires a ZIP extension to be installed on the host.', 'mailpoet'));
|
||||
}
|
||||
$processed_subscribers = call_user_func(
|
||||
@ -129,7 +129,7 @@ class Export {
|
||||
// sorted by segment name (due to slow queries when using ORDER BY and LIMIT),
|
||||
// we need to keep track of processed segments so that we do not create header
|
||||
// multiple times when switching from one segment to another and back.
|
||||
if((!count($processed_segments) || $last_segment !== $current_segment) &&
|
||||
if ((!count($processed_segments) || $last_segment !== $current_segment) &&
|
||||
(!in_array($last_segment, $processed_segments) || !in_array($current_segment, $processed_segments))
|
||||
) {
|
||||
$this->writeXLSX(
|
||||
@ -142,7 +142,7 @@ class Export {
|
||||
$last_segment = ucwords($subscriber['segment_name']);
|
||||
// detect RTL language and set Excel to properly display the sheet
|
||||
$RTL_regex = '/\p{Arabic}|\p{Hebrew}/u';
|
||||
if(!$XLSX_writer->rtl && (
|
||||
if (!$XLSX_writer->rtl && (
|
||||
preg_grep($RTL_regex, $subscriber) ||
|
||||
preg_grep($RTL_regex, $this->formatted_subscriber_fields))
|
||||
) {
|
||||
@ -166,7 +166,7 @@ class Export {
|
||||
|
||||
function getSubscribers() {
|
||||
$subscribers = $this->default_subscribers_getter->get();
|
||||
if($subscribers === false) {
|
||||
if ($subscribers === false) {
|
||||
$subscribers = $this->dynamic_subscribers_getter->get();
|
||||
}
|
||||
return $subscribers;
|
||||
|
@ -27,7 +27,7 @@ abstract class SubscribersGetter {
|
||||
|
||||
/**
|
||||
* Initialize the query by selecting fields and ignoring trashed subscribers.
|
||||
*
|
||||
*
|
||||
* @return \ORM
|
||||
*/
|
||||
protected function select() {
|
||||
@ -47,7 +47,7 @@ abstract class SubscribersGetter {
|
||||
|
||||
/**
|
||||
* Filters the subscribers query based on the segments, offset and batch size.
|
||||
*
|
||||
*
|
||||
* @param \ORM $subscribers
|
||||
* @return array
|
||||
*/
|
||||
@ -57,7 +57,7 @@ abstract class SubscribersGetter {
|
||||
* Gets the next batch of subscribers or `false` if no more!
|
||||
*/
|
||||
public function get() {
|
||||
if($this->finished) {
|
||||
if ($this->finished) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -66,10 +66,10 @@ abstract class SubscribersGetter {
|
||||
|
||||
$this->offset += $this->batch_size;
|
||||
|
||||
if(count($subscribers) < $this->batch_size) {
|
||||
if (count($subscribers) < $this->batch_size) {
|
||||
$this->finished = true;
|
||||
}
|
||||
|
||||
return $subscribers;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user