Fix code style by updated ruleset
[MAILPOET-3912]
This commit is contained in:
@@ -160,7 +160,8 @@ 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($processedSegments) || $lastSegment !== $currentSegment) &&
|
||||
if (
|
||||
(!count($processedSegments) || $lastSegment !== $currentSegment) &&
|
||||
(!in_array($lastSegment, $processedSegments) || !in_array($currentSegment, $processedSegments))
|
||||
) {
|
||||
$this->writeXLSX(
|
||||
@@ -173,7 +174,8 @@ class Export {
|
||||
$lastSegment = ucwords($subscriber['segment_name']);
|
||||
// detect RTL language and set Excel to properly display the sheet
|
||||
$rTLRegex = '/\p{Arabic}|\p{Hebrew}/u';
|
||||
if (!$xLSXWriter->rtl && (
|
||||
if (
|
||||
!$xLSXWriter->rtl && (
|
||||
preg_grep($rTLRegex, $subscriber) ||
|
||||
preg_grep($rTLRegex, $this->formattedSubscriberFieldsWithList))
|
||||
) {
|
||||
|
@@ -104,8 +104,9 @@ class Import {
|
||||
];
|
||||
// 1. data should contain all required fields
|
||||
// 2. column names should only contain alphanumeric & underscore characters
|
||||
if (count(array_intersect_key(array_flip($requiredDataFields), $data)) !== count($requiredDataFields) ||
|
||||
preg_grep('/[^a-zA-Z0-9_]/', array_keys($data['columns']))
|
||||
if (
|
||||
count(array_intersect_key(array_flip($requiredDataFields), $data)) !== count($requiredDataFields) ||
|
||||
preg_grep('/[^a-zA-Z0-9_]/', array_keys($data['columns']))
|
||||
) {
|
||||
throw new \Exception(__('Missing or invalid import data.', 'mailpoet'));
|
||||
}
|
||||
@@ -268,7 +269,7 @@ class Import {
|
||||
|
||||
// We attempt converting with both date formats
|
||||
foreach ($data as $index => $date) {
|
||||
if (empty($date) ) {
|
||||
if (empty($date)) {
|
||||
$dateTimeDates[$index] = $date;
|
||||
$customFormatDates[$index] = $date;
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user