GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 3b4963...d53694 )
by Christian
02:09
created

widget.php (151 issues)

1
<?php
0 ignored issues
show
Class file names should be based on the class name with "class-" prepended. Expected class-podlove-subscribe-button-widget.php, but found widget.php.
Loading history...
This file is missing a doc comment.
Loading history...
2
3
namespace PodloveSubscribeButton;
4
5
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
0 ignored issues
show
"include_once" is a statement not a function; no parentheses are required
Loading history...
File is being unconditionally included; use "require_once" instead
Loading history...
6
7
class Podlove_Subscribe_Button_Widget extends \WP_Widget {
0 ignored issues
show
Class name "Podlove_Subscribe_Button_Widget" is not in PascalCase format

Classes in PHP are usually named in CamelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.

Thus the name database provider becomes DatabaseProvider.

Loading history...
Coding Style Documentation introduced by
Missing doc comment for class Podlove_Subscribe_Button_Widget
Loading history...
8
9
	public function __construct() {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for function __construct()
Loading history...
10
		parent::__construct(
11
					'podlove_subscribe_button_wp_plugin_widget',
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 12 spaces, but found 20.
Loading history...
12
					( self::is_podlove_publisher_active() ? 'Podlove Subscribe Button (WordPress plugin)' : 'Podlove Subscribe Button' ),
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 12 spaces, but found 20.
Loading history...
13
					array( 'description' => __( 'Adds a Podlove Subscribe Button to your Sidebar', 'podlove-subscribe-button' ), )
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 12 spaces, but found 20.
Loading history...
Comma not allowed after last value in single-line array declaration
Loading history...
14
				);
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 8 spaces, but found 16.
Loading history...
15
	}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
16
17
	public static $widget_settings = array('infotext', 'title', 'size', 'style', 'format', 'autowidth', 'button', 'color');
0 ignored issues
show
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Missing space after array opener.
Loading history...
Missing space before array closer.
Loading history...
18
19
	public static function is_podlove_publisher_active() {
0 ignored issues
show
Method name "Podlove_Subscribe_Button_Widget::is_podlove_publisher_active" is not in camel caps format
Loading history...
Coding Style Documentation introduced by
Missing doc comment for function is_podlove_publisher_active()
Loading history...
20
		if ( is_plugin_active("podlove-podcasting-plugin-for-wordpress/podlove.php") ) {
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
Coding Style Comprehensibility introduced by
The string literal podlove-podcasting-plugi...r-wordpress/podlove.php does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
21
			return true;
22
		}
23
24
		return false;
25
	}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
26
27
	public function widget( $args, $instance ) {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for function widget()
Loading history...
28
		// Fetch the (network)button by it's name
0 ignored issues
show
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
29
		if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name($instance['button']) )
0 ignored issues
show
Coding Style Best Practice introduced by
It is generally a best practice to always use braces with control structures.

Adding braces to control structures avoids accidental mistakes as your code changes:

// Without braces (not recommended)
if (true)
    doSomething();

// Recommended
if (true) {
    doSomething();
}
Loading history...
Variable assignment found within a condition. Did you mean to do a comparison?
Loading history...
Assignments must be the first block of code on a line
Loading history...
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
30
			return sprintf( __('Oops. There is no button with the ID "%s".', 'podlove-subscribe-button'), $args['button'] );
0 ignored issues
show
A gettext call containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.
Loading history...
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
31
32
		echo $args['before_widget'];
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$args'.
Loading history...
33
		echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title'];
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$args'.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'apply_filters'.
Loading history...
Concat operator must be surrounded by a single space
Loading history...
34
35
		echo $button->render(
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$button'.
Loading history...
36
				\PodloveSubscribeButton::get_array_value_with_fallback($instance, 'size'),
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 12 spaces, but found 16.
Loading history...
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
37
				\PodloveSubscribeButton::get_array_value_with_fallback($instance, 'autowidth'),
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 12 spaces, but found 16.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'PodloveSubscribeButton'.
Loading history...
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
38
				\PodloveSubscribeButton::get_array_value_with_fallback($instance, 'style'),
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 12 spaces, but found 16.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'PodloveSubscribeButton'.
Loading history...
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
39
				\PodloveSubscribeButton::get_array_value_with_fallback($instance, 'format'), 
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 12 spaces, but found 16.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'PodloveSubscribeButton'.
Loading history...
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
40
				\PodloveSubscribeButton::get_array_value_with_fallback($instance, 'color')
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 12 spaces, but found 16.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'PodloveSubscribeButton'.
Loading history...
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
41
			);
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 8 spaces, but found 12.
Loading history...
42
		
43
		if ( strlen($instance['infotext']) )
0 ignored issues
show
Coding Style Best Practice introduced by
It is generally a best practice to always use braces with control structures.

Adding braces to control structures avoids accidental mistakes as your code changes:

// Without braces (not recommended)
if (true)
    doSomething();

// Recommended
if (true) {
    doSomething();
}
Loading history...
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
44
			echo wpautop($instance['infotext']);
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'wpautop'.
Loading history...
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
45
46
		echo $args['after_widget'];
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$args'.
Loading history...
47
	}	
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
48
49
	public function form( $instance ) {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for function form()
Loading history...
50
		foreach (self::$widget_settings as $setting) {
0 ignored issues
show
No space after opening parenthesis is prohibited
Loading history...
No space before closing parenthesis is prohibited
Loading history...
51
			$$setting = isset( $instance[$setting] ) ? $instance[$setting] : '';
0 ignored issues
show
Array keys must be surrounded by spaces unless they contain a string or an integer.
Loading history...
52
		}
53
54
		$buttons = \PodloveSubscribeButton\Model\Button::all();
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 13 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
55
		if ( is_multisite() )
0 ignored issues
show
Coding Style Best Practice introduced by
It is generally a best practice to always use braces with control structures.

Adding braces to control structures avoids accidental mistakes as your code changes:

// Without braces (not recommended)
if (true)
    doSomething();

// Recommended
if (true) {
    doSomething();
}
Loading history...
56
			$network_buttons = \PodloveSubscribeButton\Model\NetworkButton::all();
57
58
		$buttons_as_options = function ($buttons) {
0 ignored issues
show
No space after opening parenthesis is prohibited
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
59
			foreach ($buttons as $subscribebutton) {
0 ignored issues
show
No space after opening parenthesis is prohibited
Loading history...
No space before closing parenthesis is prohibited
Loading history...
60
				echo "<option value='".$subscribebutton->name."' ".( $subscribebutton->name == $button ? 'selected=\"selected\"' : '' )." >".$subscribebutton->title." (".$subscribebutton->name.")</option>";
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $button does not exist. Did you maybe mean $buttons?
Loading history...
Concat operator must be surrounded by a single space
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$subscribebutton'.
Loading history...
Found: ==. Use strict comparisons (=== or !==).
Loading history...
Coding Style Comprehensibility introduced by
The string literal > does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal ( does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal )</option> does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
61
			}
62
		}
63
		?>
64
		<p>
65
			<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'podlove-subscribe-button' ); ?></label> 
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.
Loading history...
66
			<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $title; ?>" />
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $title seems to be never defined.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$title'.
Loading history...
67
68
			<label for="<?php echo $this->get_field_id( 'color' ); ?>"><?php _e( 'Color', 'podlove-subscribe-button' ); ?></label>
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.
Loading history...
69
			<input class="podlove_subscribe_button_color" id="<?php echo $this->get_field_id( 'color' ); ?>" name="<?php echo $this->get_field_name( 'color' ); ?>" value="<?php echo $color; ?>" />
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $color seems to be never defined.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$color'.
Loading history...
70
			<style type="text/css">
71
				.sp-replacer {
72
					display: flex;
73
				}
74
				.sp-preview {
75
					flex-grow: 10;
76
				}
77
			</style>
78
79
			<label for="<?php echo $this->get_field_id( 'button' ); ?>"><?php _e( 'Button', 'podlove-subscribe-button' ); ?></label> 
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.
Loading history...
80
			<select class="widefat" id="<?php echo $this->get_field_id( 'button' ); ?>"
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
81
				      name="<?php echo $this->get_field_name( 'button' ); ?>">
0 ignored issues
show
Found precision alignment of 2 spaces.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
82
				<?php if ( isset($network_buttons) && count($network_buttons) > 0 ) : ?>
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
83
					<optgroup label="<?php _e('Local', 'podlove-subscribe-button' ); ?>">
0 ignored issues
show
All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.
Loading history...
Expected 1 spaces after opening bracket; 0 found
Loading history...
84
						<?php $buttons_as_options($buttons); ?>
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
85
					</optgroup>
86
					<optgroup label="<?php _e('Network', 'podlove-subscribe-button' ); ?>">
0 ignored issues
show
All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.
Loading history...
Expected 1 spaces after opening bracket; 0 found
Loading history...
87
						<?php $buttons_as_options($network_buttons); ?>
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
88
					</optgroup>
89
				<?php else : 
0 ignored issues
show
Opening PHP tag must be on a line by itself
Loading history...
90
					$buttons_as_options($buttons);
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
91
				 endif; ?>
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
Closing brace indented incorrectly; expected 16 spaces, found 17
Loading history...
Closing PHP tag must be on a line by itself
Loading history...
92
			</select>
93
94
			<?php
95
			$customize_options = array(
96
				'size'      => array(
97
					'name'    => __( 'Size', 'podlove-subscribe-button' ),
98
					'options' => \PodloveSubscribeButton\Model\Button::$size
0 ignored issues
show
Each array item in a multi-line array declaration must end in a comma
Loading history...
99
				),
100
				'style'     => array(
101
					'name'    => __( 'Style', 'podlove-subscribe-button' ),
102
					'options' => \PodloveSubscribeButton\Model\Button::$style
0 ignored issues
show
Each array item in a multi-line array declaration must end in a comma
Loading history...
103
				),
104
				'format'    => array(
105
					'name'    => __( 'Format', 'podlove-subscribe-button' ),
106
					'options' => \PodloveSubscribeButton\Model\Button::$format
0 ignored issues
show
Each array item in a multi-line array declaration must end in a comma
Loading history...
107
				),
108
				'autowidth' => array(
109
					'name'    => __( 'Autowidth', 'podlove-subscribe-button' ),
110
					'options' => \PodloveSubscribeButton\Model\Button::$width
0 ignored issues
show
Each array item in a multi-line array declaration must end in a comma
Loading history...
111
				)
0 ignored issues
show
Each array item in a multi-line array declaration must end in a comma
Loading history...
112
			);
113
114
			foreach ($customize_options as $slug => $properties) : ?>
0 ignored issues
show
No space after opening parenthesis is prohibited
Loading history...
No space before closing parenthesis is prohibited
Loading history...
Closing PHP tag must be on a line by itself
Loading history...
115
				<label for="<?php echo $this->get_field_id( $slug ); ?>"><?php echo $properties['name']; ?></label>
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$properties'.
Loading history...
116
				<select class="widefat" id="<?php echo $this->get_field_id( $slug ); ?>" name="<?php echo $this->get_field_name( $slug ); ?>">
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
117
					<option value="default" <?php echo ( $$slug == 'default' ? 'selected="selected"' : '' ); ?>><?php printf( __( 'Default %s', 'podlove-subscribe-button' ), $properties['name'] ) ?></option>
0 ignored issues
show
Found: ==. Use strict comparisons (=== or !==).
Loading history...
Use Yoda Condition checks, you must.
Loading history...
Inline PHP statement must end with a semicolon
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '__'.
Loading history...
A gettext call containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$properties'.
Loading history...
118
					<optgroup>
119
						<?php foreach ( $properties['options'] as $property => $name ) : ?>
120
						<option value="<?php echo $property; ?>" <?php echo ( $$slug == $property ? 'selected="selected"' : '' ); ?>><?php echo $name; ?></option>
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$property'.
Loading history...
Found: ==. Use strict comparisons (=== or !==).
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$name'.
Loading history...
121
						<?php endforeach; ?>
122
					</optgroup>
123
				</select>
124
			<?php endforeach; ?>
125
		
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
126
			<label for="<?php echo $this->get_field_id( 'infotext' ); ?>"><?php _e( 'Description', 'podlove-subscribe-button' ); ?></label> 
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
All output should be run through an escaping function (like esc_html_e() or esc_attr_e()), found '_e'.
Loading history...
127
			<textarea class="widefat" rows="10" id="<?php echo $this->get_field_id( 'infotext' ); ?>" name="<?php echo $this->get_field_name( 'infotext' ); ?>"><?php echo $infotext; ?></textarea>
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $infotext seems to be never defined.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$this'.
Loading history...
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$infotext'.
Loading history...
128
		</p>
129
		<?php 
130
	}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
131
132
	public function update( $new_instance, $old_instance ) {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for function update()
Loading history...
133
		$instance = array();
134
135
		foreach (self::$widget_settings as $setting) {
0 ignored issues
show
No space after opening parenthesis is prohibited
Loading history...
No space before closing parenthesis is prohibited
Loading history...
136
			$instance[$setting]  = ( ! empty( $new_instance[$setting] ) ) ? strip_tags( $new_instance[$setting] ) : '';
0 ignored issues
show
Array keys must be surrounded by spaces unless they contain a string or an integer.
Loading history...
Equals sign not aligned correctly; expected 1 space but found 2 spaces

This check looks for improperly formatted assignments.

Every assignment must have exactly one space before and one space after the equals operator.

To illustrate:

$a = "a";
$ab = "ab";
$abc = "abc";

will have no issues, while

$a   = "a";
$ab  = "ab";
$abc = "abc";

will report issues in lines 1 and 2.

Loading history...
strip_tags() is discouraged. Use the more comprehensive wp_strip_all_tags() instead.
Loading history...
137
		}
138
139
		return $instance;
140
	}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
141
}
142
add_action( 'widgets_init', function(){
0 ignored issues
show
Expected 1 space before opening brace; found 0
Loading history...
143
     register_widget( '\PodloveSubscribeButton\Podlove_Subscribe_Button_Widget' );
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
144
});