Skip to content

Commit 804aa8d

Browse files
force short array notation, ditch wpcs
1 parent cff3be2 commit 804aa8d

File tree

97 files changed

+5385
-5536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+5385
-5536
lines changed

.editorconfig

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,11 @@ charset = utf-8
1111
end_of_line = lf
1212
insert_final_newline = true
1313
trim_trailing_whitespace = true
14-
indent_style = tab
15-
16-
[*.yml]
1714
indent_style = space
1815
indent_size = 2
1916

20-
[*.js]
21-
indent_style = space
22-
indent_size = 2
17+
[*.php]
18+
indent_size = 4
2319

2420
[*.md]
2521
trim_trailing_whitespace = false

composer.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
"require-dev": {
2424
"phpunit/phpunit": "^9.0",
2525
"brain/monkey": "^2.2",
26-
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
27-
"wp-coding-standards/wpcs": "dev-develop"
26+
"squizlabs/php_codesniffer": "^3.11"
2827
},
2928
"scripts": {
3029
"make-pot": "wp i18n make-pot . languages/mailchimp-for-wp.pot --exclude=assets/js",
@@ -33,9 +32,6 @@
3332
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -not -path './node_modules/*' -not -path './assets/*' -print0 | xargs -0 -n1 php -l"
3433
},
3534
"config": {
36-
"allow-plugins": {
37-
"dealerdirect/phpcodesniffer-composer-installer": true
38-
}
3935
},
4036
"minimum-stability": "dev"
4137
}

config/default-form-messages.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
<?php
22

3-
return array(
4-
'subscribed' => array(
3+
return [
4+
'subscribed' => [
55
'type' => 'success',
66
'text' => esc_html__('Thank you, your sign-up request was successful! Please check your email inbox to confirm.', 'mailchimp-for-wp'),
7-
),
8-
'updated' => array(
7+
],
8+
'updated' => [
99
'type' => 'success',
1010
'text' => esc_html__('Thank you, your records have been updated!', 'mailchimp-for-wp'),
11-
),
12-
'unsubscribed' => array(
11+
],
12+
'unsubscribed' => [
1313
'type' => 'success',
1414
'text' => esc_html__('You were successfully unsubscribed.', 'mailchimp-for-wp'),
15-
),
16-
'not_subscribed' => array(
15+
],
16+
'not_subscribed' => [
1717
'type' => 'notice',
1818
'text' => esc_html__('Given email address is not subscribed.', 'mailchimp-for-wp'),
19-
),
20-
'error' => array(
19+
],
20+
'error' => [
2121
'type' => 'error',
2222
'text' => esc_html__('Oops. Something went wrong. Please try again later.', 'mailchimp-for-wp'),
23-
),
24-
'invalid_email' => array(
23+
],
24+
'invalid_email' => [
2525
'type' => 'error',
2626
'text' => esc_html__('Please provide a valid email address.', 'mailchimp-for-wp'),
27-
),
28-
'already_subscribed' => array(
27+
],
28+
'already_subscribed' => [
2929
'type' => 'notice',
3030
'text' => esc_html__('Given email address is already subscribed, thank you!', 'mailchimp-for-wp'),
31-
),
32-
'required_field_missing' => array(
31+
],
32+
'required_field_missing' => [
3333
'type' => 'error',
3434
'text' => esc_html__('Please fill in the required fields.', 'mailchimp-for-wp'),
35-
),
36-
'no_lists_selected' => array(
35+
],
36+
'no_lists_selected' => [
3737
'type' => 'error',
3838
'text' => esc_html__('Please select at least one list.', 'mailchimp-for-wp'),
39-
),
40-
);
39+
],
40+
];

config/default-form-settings.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
return array(
3+
return [
44
'css' => 0,
55
'double_optin' => 1,
66
'hide_after_success' => 0,
7-
'lists' => array(),
7+
'lists' => [],
88
'redirect' => '',
99
'replace_interests' => 1,
1010
'required_fields' => '',
1111
'update_existing' => 0,
1212
'subscriber_tags' => '',
13-
);
13+
];

config/default-settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

3-
return array(
3+
return [
44
'api_key' => '',
55
'allow_usage_tracking' => 0,
66
'debug_log_level' => 'warning',
7-
);
7+
];

includes/admin/class-admin-ajax.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public function __construct(MC4WP_Admin_Tools $tools)
2222
*/
2323
public function add_hooks()
2424
{
25-
add_action('wp_ajax_mc4wp_renew_mailchimp_lists', array( $this, 'refresh_mailchimp_lists' ));
26-
add_action('wp_ajax_mc4wp_get_list_details', array( $this, 'get_list_details' ));
25+
add_action('wp_ajax_mc4wp_renew_mailchimp_lists', [ $this, 'refresh_mailchimp_lists' ]);
26+
add_action('wp_ajax_mc4wp_get_list_details', [ $this, 'get_list_details' ]);
2727
}
2828

2929
/**
@@ -55,15 +55,15 @@ public function get_list_details()
5555
}
5656

5757
$list_ids = (array) explode(',', $_GET['ids']);
58-
$data = array();
58+
$data = [];
5959
$mailchimp = new MC4WP_MailChimp();
6060
foreach ($list_ids as $list_id) {
61-
$data[] = (object) array(
61+
$data[] = (object) [
6262
'id' => $list_id,
6363
'merge_fields' => $mailchimp->get_list_merge_fields($list_id),
6464
'interest_categories' => $mailchimp->get_list_interest_categories($list_id),
6565
'marketing_permissions' => $mailchimp->get_list_marketing_permissions($list_id),
66-
);
66+
];
6767
}
6868

6969
if (isset($_GET['format']) && $_GET['format'] === 'html') {

includes/admin/class-admin-messages.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ class MC4WP_Admin_Messages
2323
*/
2424
public function add_hooks()
2525
{
26-
add_action('admin_notices', array( $this, 'show' ));
27-
register_shutdown_function(array( $this, 'save' ));
26+
add_action('admin_notices', [ $this, 'show' ]);
27+
register_shutdown_function([ $this, 'save' ]);
2828
}
2929

3030
private function load()
3131
{
3232
if (is_null($this->bag)) {
33-
$this->bag = get_option('mc4wp_flash_messages', array());
33+
$this->bag = get_option('mc4wp_flash_messages', []);
3434
}
3535
}
3636

3737
// empty flash bag
3838
private function reset()
3939
{
40-
$this->bag = array();
40+
$this->bag = [];
4141
$this->dirty = true;
4242
}
4343

@@ -50,10 +50,10 @@ private function reset()
5050
public function flash($message, $type = 'success')
5151
{
5252
$this->load();
53-
$this->bag[] = array(
53+
$this->bag[] = [
5454
'text' => $message,
5555
'type' => $type,
56-
);
56+
];
5757
$this->dirty = true;
5858
}
5959

includes/admin/class-admin-texts.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ public function add_hooks()
2828
{
2929
global $pagenow;
3030

31-
add_filter('admin_footer_text', array( $this, 'footer_text' ));
31+
add_filter('admin_footer_text', [ $this, 'footer_text' ]);
3232

3333
// Hooks for Plugins overview page
3434
if ($pagenow === 'plugins.php') {
35-
add_filter('plugin_action_links_' . $this->plugin_file, array( $this, 'add_plugin_settings_link' ), 10, 2);
36-
add_filter('plugin_row_meta', array( $this, 'add_plugin_meta_links' ), 10, 2);
35+
add_filter('plugin_action_links_' . $this->plugin_file, [ $this, 'add_plugin_settings_link' ], 10, 2);
36+
add_filter('plugin_row_meta', [ $this, 'add_plugin_meta_links' ], 10, 2);
3737
}
3838
}
3939

0 commit comments

Comments
 (0)