Add space between switch and ‘(‘

[MAILPOET-1791]
This commit is contained in:
Ján Mikláš
2019-02-13 12:54:08 +01:00
committed by M. Shull
parent ebbdec5ebd
commit a8972ca281
27 changed files with 43 additions and 43 deletions

View File

@ -63,7 +63,7 @@ class Services extends APIEndpoint {
return $this->successResponse(array('message' => $success_message));
}
switch($state) {
switch ($state) {
case Bridge::KEY_INVALID:
$error = __('Your MailPoet Sending Service key is invalid.', 'mailpoet');
break;
@ -128,7 +128,7 @@ class Services extends APIEndpoint {
);
}
switch($state) {
switch ($state) {
case Bridge::KEY_INVALID:
$error = __('Your Premium key is invalid.', 'mailpoet');
break;
@ -148,7 +148,7 @@ class Services extends APIEndpoint {
}
private function getErrorDescriptionByCode($code) {
switch($code) {
switch ($code) {
case Bridge::CHECK_ERROR_UNAVAILABLE:
$text = __('Service unavailable', 'mailpoet');
break;

View File

@ -468,7 +468,7 @@ class MP2Migrator {
*/
private function mapCustomFieldType($mp2_type) {
$type = '';
switch($mp2_type) {
switch ($mp2_type) {
case 'input':
$type = 'text';
break;
@ -499,7 +499,7 @@ class MP2Migrator {
$params['validate'] = $this->mapCustomFieldValidateValue($params['validate']);
}
if(isset($params['date_order'])) { // Convert the date_order field
switch($params['date_type']) {
switch ($params['date_type']) {
case 'year_month':
if(preg_match('/y$/i', $params['date_order'])) {
@ -533,7 +533,7 @@ class MP2Migrator {
*/
private function mapCustomFieldValidateValue($mp2_value) {
$value = '';
switch($mp2_value) {
switch ($mp2_value) {
case 'onlyLetterSp':
case 'onlyLetterNumber':
$value = 'alphanum';
@ -648,7 +648,7 @@ class MP2Migrator {
private function mapUserStatus($mp2_user_status) {
switch($mp2_user_status) {
switch ($mp2_user_status) {
case 1:
$status = 'subscribed';
break;
@ -881,7 +881,7 @@ class MP2Migrator {
if($type == 'segment') {
$field_id = 'segments';
} else {
switch($field['field']) {
switch ($field['field']) {
case 'firstname':
$field_id = 'first_name';
break;
@ -1123,7 +1123,7 @@ class MP2Migrator {
* @return string Interval
*/
private function mapFrequencyInterval($interval_str) {
switch($interval_str) {
switch ($interval_str) {
case 'one_min':
$interval = 1;
break;
@ -1157,7 +1157,7 @@ class MP2Migrator {
if(empty($emails_number)) {
$emails_number = 70;
} else {
switch($interval_str) {
switch ($interval_str) {
case 'thirty_min':
$emails_number /= 2;
break;

View File

@ -45,7 +45,7 @@ class Date extends Base {
if(strlen(trim($value)) > 0) {
$value = explode('-', $value);
switch($block['params']['date_type']) {
switch ($block['params']['date_type']) {
case 'year_month_day':
$year = (isset($value[0]) ? (int)$value[0] : null);
$month = (isset($value[1]) ? (int)$value[1] : null);

View File

@ -76,7 +76,7 @@ class Renderer {
static function renderBlock($block = array()) {
$html = '';
switch($block['type']) {
switch ($block['type']) {
case 'html':
$html .= Block\Html::render($block);
break;

View File

@ -14,7 +14,7 @@ class Export {
}
static function get($type = 'html', $form = null) {
switch($type) {
switch ($type) {
case 'iframe':
// generate url to load iframe's content
$iframe_url = add_query_arg(array(

View File

@ -42,7 +42,7 @@ class Mailer {
}
function buildMailer() {
switch($this->mailer_config['method']) {
switch ($this->mailer_config['method']) {
case self::METHOD_AMAZONSES:
$mailer_instance = new $this->mailer_config['class'](
$this->mailer_config['region'],

View File

@ -28,7 +28,7 @@ class MailPoetMapper {
$subscribers_errors = [];
$result_code = !empty($result['code']) ? $result['code'] : null;
switch($result_code) {
switch ($result_code) {
case API::RESPONSE_CODE_NOT_ARRAY:
$message = __('JSON input is not an array', 'mailpoet');
break;

View File

@ -34,7 +34,7 @@ class MailPoet {
$message_body = $this->getBody($newsletter, $subscriber, $extra_params);
$result = $this->api->sendMessages($message_body);
switch($result['status']) {
switch ($result['status']) {
case API::SENDING_STATUS_CONNECTION_ERROR:
$error = $this->error_mapper->getConnectionError($result['message']);
return Mailer::formatMailerErrorResult($error);

View File

@ -61,7 +61,7 @@ class CustomField extends Model {
: 'year_month_day'
);
$date_parts = explode('_', $date_type);
switch($date_type) {
switch ($date_type) {
case 'year_month_day':
$value = sprintf(
'%s/%s/%s',

View File

@ -200,7 +200,7 @@ class Model extends \Sudzy\ValidModel {
} catch(\Sudzy\ValidationException $e) {
$this->setError($e->getValidationErrors());
} catch(\PDOException $e) {
switch($e->getCode()) {
switch ($e->getCode()) {
case 23000:
preg_match("/for key \'(.*?)\'/i", $e->getMessage(), $matches);
if(isset($matches[1])) {

View File

@ -771,7 +771,7 @@ class Newsletter extends Model {
)
);
switch($type) {
switch ($type) {
case self::TYPE_STANDARD:
$groups = array_merge($groups, array(
array(
@ -847,7 +847,7 @@ class Newsletter extends Model {
static function groupBy($orm, $data = array()) {
$group = (!empty($data['group'])) ? $data['group'] : 'all';
switch($group) {
switch ($group) {
case self::STATUS_DRAFT:
case self::STATUS_SCHEDULED:
case self::STATUS_SENDING:

View File

@ -116,7 +116,7 @@ class Renderer {
function renderStyles($styles) {
$css = '';
foreach ($styles as $selector => $style) {
switch($selector) {
switch ($selector) {
case 'text':
$selector = 'td.mailpoet_paragraph, td.mailpoet_blockquote, li.mailpoet_paragraph';
break;

View File

@ -193,7 +193,7 @@ class Scheduler {
$nth_week_day = ($newsletter->nthWeekDay === self::LAST_WEEKDAY_FORMAT) ?
$newsletter->nthWeekDay :
'#' . $newsletter->nthWeekDay;
switch($interval_type) {
switch ($interval_type) {
case self::INTERVAL_IMMEDIATE:
case self::INTERVAL_DAILY:
$schedule = sprintf('0 %s * * *', $hour);
@ -255,7 +255,7 @@ class Scheduler {
static function getScheduledTimeWithDelay($after_time_type, $after_time_number) {
$wp = new WPFunctions();
$current_time = Carbon::createFromTimestamp($wp->currentTime('timestamp'));
switch($after_time_type) {
switch ($after_time_type) {
case 'hours':
return $current_time->addHours($after_time_number);
case 'days':

View File

@ -18,7 +18,7 @@ class Link {
$content,
$wp_user_preview
) {
switch($shortcode_details['action']) {
switch ($shortcode_details['action']) {
case 'subscription_unsubscribe_url':
return self::processUrl(
$shortcode_details['action'],
@ -72,7 +72,7 @@ class Link {
static function processShortcodeAction(
$shortcode_action, $newsletter, $subscriber, $queue, $wp_user_preview
) {
switch($shortcode_action) {
switch ($shortcode_action) {
case 'subscription_unsubscribe_url':
$settings = new SettingsController();
// track unsubscribe event

View File

@ -15,7 +15,7 @@ class Newsletter {
$queue,
$content
) {
switch($shortcode_details['action']) {
switch ($shortcode_details['action']) {
case 'subject':
return ($newsletter) ? $newsletter->subject : false;

View File

@ -16,7 +16,7 @@ class Subscriber {
$default_value = ($shortcode_details['action_argument'] === 'default') ?
$shortcode_details['action_argument_value'] :
'';
switch($shortcode_details['action']) {
switch ($shortcode_details['action']) {
case 'firstname':
return (!empty($subscriber->first_name)) ? $subscriber->first_name : $default_value;
case 'lastname':

View File

@ -20,7 +20,7 @@ class Url {
if($subscriber instanceof SubscriberModel) {
$subscriber->token = SubscriberModel::generateToken($subscriber->email);
}
switch($type) {
switch ($type) {
case self::TYPE_ARCHIVE:
// do not expose newsletter id when displaying archive newsletters
$newsletter->id = null;

View File

@ -21,7 +21,7 @@ class WP {
->findOne();
$schedule_welcome_newsletter = false;
switch(current_filter()) {
switch (current_filter()) {
case 'delete_user':
case 'deleted_user':
case 'remove_user_from_blog':

View File

@ -34,7 +34,7 @@ class WooCommerce {
if($wc_segment === false) return;
$current_filter = $current_filter ?: $this->wp->currentFilter();
switch($current_filter) {
switch ($current_filter) {
case 'woocommerce_delete_customer':
// subscriber should be already deleted in WP users sync
$this->unsubscribeUsersFromSegment(); // remove leftover association

View File

@ -46,7 +46,7 @@ class API {
);
$code = $this->wp->wpRemoteRetrieveResponseCode($result);
switch($code) {
switch ($code) {
case 200:
$body = json_decode($this->wp->wpRemoteRetrieveBody($result), true);
break;
@ -65,7 +65,7 @@ class API {
);
$code = $this->wp->wpRemoteRetrieveResponseCode($result);
switch($code) {
switch ($code) {
case 200:
if($body = $this->wp->wpRemoteRetrieveBody($result)) {
$body = json_decode($body, true);

View File

@ -22,7 +22,7 @@ class API {
);
$code = $this->wp->wpRemoteRetrieveResponseCode($result);
switch($code) {
switch ($code) {
case 200:
if($body = $this->wp->wpRemoteRetrieveBody($result)) {
$body = json_decode($body);

View File

@ -127,7 +127,7 @@ class MailChimp {
function throwException($error) {
$errorMessage = __('Unknown MailChimp error.', 'mailpoet');
switch($error) {
switch ($error) {
case 'API':
$errorMessage = __('Invalid API Key.', 'mailpoet');
break;

View File

@ -133,7 +133,7 @@ class Pages {
return $page_title;
} else {
// when it's our own page, generate page title based on requested action
switch($this->action) {
switch ($this->action) {
case self::ACTION_CONFIRM:
return $this->getConfirmTitle();
@ -157,7 +157,7 @@ class Pages {
if(strpos($page_content, '[mailpoet_page]') !== false) {
$content = '';
switch($this->action) {
switch ($this->action) {
case self::ACTION_CONFIRM:
$content = $this->getConfirmContent();
break;

View File

@ -30,7 +30,7 @@ class Handlebars extends \Twig_Extension {
// default values
$alias = null;
switch($args_count) {
switch ($args_count) {
case 2:
list($id, $file) = $args;
break;

View File

@ -33,7 +33,7 @@ class Helpers {
static function getMaxPostSize($bytes = false) {
$maxPostSize = ini_get('post_max_size');
if(!$bytes) return $maxPostSize;
switch(substr($maxPostSize, -1)) {
switch (substr($maxPostSize, -1)) {
case 'M':
case 'm':
return (int)$maxPostSize * 1048576;

View File

@ -42,7 +42,7 @@ class PermanentNotices {
function ajaxDismissNoticeHandler() {
if(!isset($_POST['type'])) return;
switch($_POST['type']) {
switch ($_POST['type']) {
case (PHPVersionWarnings::OPTION_NAME):
$this->php_version_warnings->disable();
break;

View File

@ -39,7 +39,7 @@ class BridgeTestMockAPI {
}
private function processAPICheckResponse($code) {
switch($code) {
switch ($code) {
case 'expiring':
// a special case of a valid key
$code = 200;
@ -58,7 +58,7 @@ class BridgeTestMockAPI {
}
private function processPremiumResponse($code) {
switch($code) {
switch ($code) {
case 'expiring':
// a special case of a valid key
$code = 200;