Skip to content

Commit

Permalink
updated for phpcs configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
BeycanDeveloper committed Mar 6, 2024
1 parent c1f2aa7 commit 7318859
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion app/DonateBox/DonateBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DonateBox
public function __construct()
{
add_action('init', function (): void {
add_shortcode('cryptopay-donation-box', array($this, 'init'));
add_shortcode('cryptopay-donation-box', [$this, 'init']);
});
}

Expand Down
6 changes: 3 additions & 3 deletions app/Integrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct()
// Register Gutenberg block
add_action('enqueue_block_editor_assets', function (): void {
global $pagenow;
$dependencies = $pagenow === 'widgets.php' ? ['wp-edit-widgets'] : ['wp-editor'];
$dependencies = 'widgets.php' === $pagenow ? ['wp-edit-widgets'] : ['wp-editor'];

Helpers::getAddon('donation')->addScript(
'gutenberg.js',
Expand Down Expand Up @@ -55,9 +55,9 @@ public function __construct()
Helpers::getSetting('donationShowInPages') :
Helpers::getSetting('donationShowInPosts');

if ($showIn == 'show-in-begin') {
if ('show-in-begin' == $showIn) {
$content = do_shortcode('[cryptopay-donation-box]') . $content;
} elseif ($showIn == 'show-in-end') {
} elseif ('show-in-end' == $showIn) {
$content .= do_shortcode('[cryptopay-donation-box]');
}
}
Expand Down
56 changes: 28 additions & 28 deletions app/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,52 +16,52 @@ class Settings
*/
public function __construct()
{
Setting::createSection(array(
Setting::createSection([
'id' => 'donate',
'title' => esc_html__('Donation settings', 'cryptopay'),
'icon' => 'fas fa-donate',
'fields' => array(
array(
'fields' => [
[
'id' => 'donationShortCode',
'title' => esc_html__('Shortcode', 'cryptopay'),
'type' => 'content',
'content' => '[cryptopay-donation-box]'
),
array(
],
[
'id' => 'donationCurrency',
'type' => 'select',
'title' => esc_html__('Currency', 'cryptopay'),
'options' => Constants::getCountryCurrencies(),
'default' => 'USD'
),
array(
],
[
'id' => 'donationDonateAmounts',
'type' => 'group',
'title' => esc_html__('Donate amounts', 'cryptopay'),
'button_title' => esc_html__('Add new', 'cryptopay'),
'fields' => array(
array(
'fields' => [
[
'title' => esc_html__('Value', 'cryptopay'),
'id' => 'value',
'type' => 'number',
),
),
'default' => array(
array(
],
],
'default' => [
[
'value' => 10
),
array(
],
[
'value' => 30
),
array(
],
[
'value' => 50
),
array(
],
[
'value' => 100
)
)
),
array(
]
]
],
[
'id' => 'donationShowInPosts',
'title' => esc_html__('Show in posts', 'cryptopay'),
'type' => 'select',
Expand All @@ -72,8 +72,8 @@ public function __construct()
'show-in-end' => esc_html__('Show in end', 'cryptopay')
],
'default' => 'not-show'
),
array(
],
[
'id' => 'donationShowInPages',
'title' => esc_html__('Show in pages', 'cryptopay'),
'type' => 'select',
Expand All @@ -84,8 +84,8 @@ public function __construct()
'show-in-end' => esc_html__('Show in end', 'cryptopay')
],
'default' => 'not-show'
),
)
));
],
]
]);
}
}

0 comments on commit 7318859

Please sign in to comment.