Skip to content

Commit

Permalink
updated for phpcs configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBeycan committed Mar 6, 2024
1 parent 55a90ac commit 889a532
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions classes/DokanCryptoPayWithdrawal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion dokan-cryptopay-withdrawal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down

0 comments on commit 889a532

Please sign in to comment.