Fix code style by updated ruleset

[MAILPOET-3912]
This commit is contained in:
Jan Lysý
2021-12-20 15:13:17 +01:00
committed by Veljko V
parent c0302d8284
commit 09c2ce653c
55 changed files with 201 additions and 133 deletions

View File

@@ -28,7 +28,8 @@ class Installer {
}
public function getPluginInformation($data, $action = '', $args = null) {
if ($action === 'plugin_information'
if (
$action === 'plugin_information'
&& isset($args->slug)
&& $args->slug === $this->slug
) {

View File

@@ -499,7 +499,8 @@ class Menu {
return false;
}
// Check if page already exists
if (get_plugin_page_hook($_REQUEST['page'], '')
if (
get_plugin_page_hook($_REQUEST['page'], '')
|| WPFunctions::get()->getPluginPageHook($_REQUEST['page'], self::MAIN_PAGE_SLUG)
) {
return false;

View File

@@ -304,7 +304,7 @@ class Populator {
'enabled' => empty($settingsDbVersion), // enable on new installs only
'message' => $currentLabelText,
]);
} elseif (isset($woocommerceOptinOnCheckout['message']) && $woocommerceOptinOnCheckout['message'] === $legacyLabelText ) {
} elseif (isset($woocommerceOptinOnCheckout['message']) && $woocommerceOptinOnCheckout['message'] === $legacyLabelText) {
$this->settings->set('woocommerce.optin_on_checkout.message', $currentLabelText);
}
// reset mailer log

View File

@@ -33,7 +33,8 @@ class ServicesChecker {
$mssKeySpecified = Bridge::isMSSKeySpecified();
$mssKey = $this->settings->get(Bridge::API_KEY_STATE_SETTING_NAME);
if (!$mssKeySpecified
if (
!$mssKeySpecified
|| empty($mssKey['state'])
|| $mssKey['state'] == Bridge::KEY_INVALID
) {
@@ -49,7 +50,8 @@ class ServicesChecker {
WPNotice::displayError($error, '', '', false, false);
}
return false;
} elseif ($mssKey['state'] == Bridge::KEY_EXPIRING
} elseif (
$mssKey['state'] == Bridge::KEY_EXPIRING
&& !empty($mssKey['data']['expire_at'])
) {
if ($displayErrorNotice) {
@@ -80,7 +82,8 @@ class ServicesChecker {
$displayErrorNotice = false;
}
if (!$premiumKeySpecified
if (
!$premiumKeySpecified
|| empty($premiumKey['state'])
|| $premiumKey['state'] === Bridge::KEY_INVALID
|| $premiumKey['state'] === Bridge::KEY_ALREADY_USED
@@ -102,7 +105,8 @@ class ServicesChecker {
WPNotice::displayWarning($error);
}
return false;
} elseif ($premiumKey['state'] === Bridge::KEY_EXPIRING
} elseif (
$premiumKey['state'] === Bridge::KEY_EXPIRING
&& !empty($premiumKey['data']['expire_at'])
) {
if ($displayErrorNotice) {