diff --git a/classes/DokanCryptoPayWithdrawal.php b/classes/DokanCryptoPayWithdrawal.php index 15f6eb7..d9e3013 100644 --- a/classes/DokanCryptoPayWithdrawal.php +++ b/classes/DokanCryptoPayWithdrawal.php @@ -59,11 +59,11 @@ public function __construct(string $title, string $key) add_filter('dokan_withdraw_method_additional_info', [$this, 'addWithdrawMethodAdditionalInfo'], 10, 2); // Actions - if (isset($_GET['page']) && $_GET['page'] == 'dokan') { + if (isset($_GET['page']) && 'dokan' == $_GET['page']) { add_action('admin_print_footer_scripts', [$this, 'withdrawDetails'], 99); } - if ($this->key == 'dokan_cryptopay') { + if ('dokan_cryptopay' == $this->key) { Helpers::registerIntegration($this->key); Hook::addFilter('apply_discount_' . $this->key, '__return_false'); Hook::addFilter('receiver_' . $this->key, function (string $receiver, object $data) { @@ -92,10 +92,10 @@ public function __construct(string $title, string $key) */ public function addWithdrawMethod(array $methods): array { - $methods[$this->key] = array( + $methods[$this->key] = [ 'title' => $this->title, 'callback' => [$this, 'userSettingForm'], - ); + ]; return $methods; } @@ -130,7 +130,7 @@ private function isSelected(object $network, array $networkItem): bool return false; } - if ($networkItem['code'] == 'evmchains') { + if ('evmchains' == $networkItem['code']) { $res = $networkItem['id'] == $network->id; } else { $res = $networkItem['code'] == $network->code; @@ -172,7 +172,7 @@ public function userSettingForm(array $args): void $currency = isset($settings['currency']) ? json_decode($settings['currency']) : (object) []; $address = isset($settings['address']) ? $settings['address'] : ''; - if ($this->key == 'dokan_cryptopay') { + if ('dokan_cryptopay' == $this->key) { $this->networks = Helpers::getNetworks()->toArray(); } else { $this->networks = $this->getNetworksById(); @@ -397,7 +397,7 @@ function getCustomPaymentDetails(details, method, data) { */ public function runCryptoPay(): string { - if ($this->key == 'dokan_cryptopay') { + if ('dokan_cryptopay' == $this->key) { return (new Payment($this->key))->setConfirmation(false)->html(); } else { return (new LitePayment($this->key))->setConfirmation(false)->html(); diff --git a/dokan-cryptopay-withdrawal.php b/dokan-cryptopay-withdrawal.php index c9f8d3b..5259122 100644 --- a/dokan-cryptopay-withdrawal.php +++ b/dokan-cryptopay-withdrawal.php @@ -61,7 +61,7 @@ $gateway = new DokanCryptoPayWithdrawal(esc_html__('CryptoPay Lite', 'dokan-cryptopay'), 'dokan_cryptopay_lite'); } - if (isset($_GET['page']) && $_GET['page'] === 'dokan') { + if (isset($_GET['page']) && 'dokan' === $_GET['page']) { add_action('admin_enqueue_scripts', function (): void { wp_enqueue_script('dokan-cryptopay', plugin_dir_url(__FILE__) . 'assets/js/main.js', ['jquery'], DOKAN_CRYPTOPAY_VERSION, true); wp_localize_script('dokan-cryptopay', 'DokanCryptoPay', [