Skip to content

Commit 4dc630d

Browse files
Another fixes
1 parent 8774536 commit 4dc630d

File tree

6 files changed

+35
-27
lines changed

6 files changed

+35
-27
lines changed

includes/admin.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
2-
3-
/*
2+
/**
43
* mailgun-wordpress-plugin - Sending mail from WordPress using Mailgun
54
* Copyright (C) 2016 Mailgun, et al.
65
*
@@ -17,8 +16,9 @@
1716
* You should have received a copy of the GNU General Public License along
1817
* with this program; if not, write to the Free Software Foundation, Inc.,
1918
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19+
*
20+
* @package Mailgun
2021
*/
21-
2222
class MailgunAdmin extends Mailgun {
2323

2424
/**
@@ -31,6 +31,9 @@ class MailgunAdmin extends Mailgun {
3131
*/
3232
protected array $options = array();
3333

34+
/**
35+
* @var string $hook_suffix
36+
*/
3437
protected $hook_suffix;
3538

3639
/**
@@ -400,11 +403,10 @@ public function filter_plugin_actions( array $links ): array {
400403
/**
401404
* AJAX callback function to test mail sending functionality.
402405
*
403-
* @return string
404-
*
406+
* @return void
405407
* @throws JsonException
406408
*/
407-
public function ajax_send_test(): string {
409+
public function ajax_send_test(): void {
408410
nocache_headers();
409411
header('Content-Type: application/json');
410412

includes/mg-filter.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
2-
3-
/*
2+
/**
43
* mailgun-wordpress-plugin - Sending mail from Wordpress using Mailgun
54
* Copyright (C) 2016 Mailgun, et al.
65
*
@@ -17,9 +16,10 @@
1716
* You should have received a copy of the GNU General Public License along
1817
* with this program; if not, write to the Free Software Foundation, Inc.,
1918
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19+
*
20+
* @package Mailgun
2021
*/
2122

22-
2323
/**
2424
* Tries several methods to get the MIME Content-Type of a file.
2525
*
@@ -60,6 +60,7 @@ function get_mime_content_type( string $filepath, string $default_type = 'text/p
6060
* `$from_addr` before being returned. The filtered result is null-tested
6161
* before being returned.
6262
*
63+
* @param string $from_name_header
6364
* @return string
6465
*
6566
* @since 1.5.8
@@ -108,7 +109,7 @@ function mg_detect_from_name( $from_name_header = null ): string {
108109
* This operates as a filter for the from address. If the override is set,
109110
* a given address will except in ONE case.
110111
* If the override is not enabled this is the from address resolution order:
111-
* 1. From address given by headers - {@param $from_addr_header}
112+
* 1. From address given by headers - {$from_addr_header}
112113
* 2. From address set in Mailgun settings
113114
* 3. From `MAILGUN_FROM_ADDRESS` constant
114115
* 4. From address constructed as `wordpress@<your_site_domain>`
@@ -123,8 +124,7 @@ function mg_detect_from_name( $from_name_header = null ): string {
123124
* might appear to be another option but some hosts may refuse to
124125
* relay mail from an unknown domain.
125126
*
126-
* @link http://trac.wordpress.org/ticket/5007.
127-
*
127+
* @param null $from_addr_header
128128
* @return string
129129
*
130130
* @since 1.5.8

includes/options-page.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
2-
3-
/*
2+
/**
43
* mailgun-wordpress-plugin - Sending mail from Wordpress using Mailgun
54
* Copyright (C) 2016 Mailgun, et al.
65
*
@@ -17,6 +16,8 @@
1716
* You should have received a copy of the GNU General Public License along
1817
* with this program; if not, write to the Free Software Foundation, Inc.,
1918
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19+
*
20+
* @package Mailgun
2021
*/
2122

2223
$mailgun = Mailgun::getInstance();

includes/widget.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
2-
3-
/*
4-
* mailgun-wordpress-plugin - Sending mail from Wordpress using Mailgun
2+
/**
3+
* @file wp-content/plugins/wordpress-plugin/includes/widget.php
4+
* Mailgun-wordpress-plugin - Sending mail from Wordpress using Mailgun
55
* Copyright (C) 2016 Mailgun, et al.
66
*
77
* This program is free software; you can redistribute it and/or modify
@@ -17,10 +17,14 @@
1717
* You should have received a copy of the GNU General Public License along
1818
* with this program; if not, write to the Free Software Foundation, Inc.,
1919
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* @package Mailgun
2022
*/
23+
class List_Widget extends \WP_Widget {
2124

22-
class list_widget extends \WP_Widget {
23-
25+
/**
26+
* Register widget with WordPress.
27+
*/
2428
public function __construct() {
2529
parent::__construct(
2630
// Base ID of your widget
@@ -33,8 +37,8 @@ public function __construct() {
3337
}
3438

3539
/**
36-
* @param $args
37-
* @param $instance
40+
* @param mixed $args
41+
* @param mixed $instance
3842
* @return void
3943
* @throws JsonException
4044
*/
@@ -65,7 +69,7 @@ public function widget( $args, $instance ) {
6569
// Widget Backend
6670

6771
/**
68-
* @param $instance
72+
* @param mixed $instance
6973
* @return string|void
7074
*/
7175
public function form( $instance ) {
@@ -107,11 +111,9 @@ public function form( $instance ) {
107111
<?php
108112
}
109113

110-
// Updating widget replacing old instances with new
111-
112114
/**
113-
* @param $new_instance
114-
* @param $old_instance
115+
* @param mixed $new_instance
116+
* @param mixed $old_instance
115117
* @return array
116118
*/
117119
public function update( $new_instance, $old_instance ) {

mailgun.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ public function build_list_form( array $atts ): string {
514514
* Initialize List Widget.
515515
*/
516516
public function load_list_widget() {
517-
register_widget( 'list_widget' );
517+
register_widget( 'List_Widget' );
518518
add_shortcode( 'mailgun', array( &$this, 'build_list_form' ) );
519519
}
520520

phpcs.xml.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,8 @@
104104
<exclude name="Generic.CodeAnalysis.AssignmentInCondition.Found"/>
105105
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure"/>
106106
<exclude name="Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceBeforeClose"/>
107+
<exclude name="WordPress.PHP.DontExtract.extract_extract"/>
108+
<exclude name="Squiz.Commenting.FileComment.Missing"/>
109+
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
107110
</rule>
108111
</ruleset>

0 commit comments

Comments
 (0)