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
Pull Request — master (#55)
by Christian
04:15
created
podlove.php 3 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -188,8 +188,9 @@
 block discarded – undo
188 188
 		}
189 189
 
190 190
 		// Fetch the (network)button by it's name
191
-		if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name( $args[ 'button' ] ) )
192
-			return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args[ 'button' ] );
191
+		if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name( $args[ 'button' ] ) ) {
192
+					return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args[ 'button' ] );
193
+		}
193 194
 
194 195
 		// Get button styling and options
195 196
 		$autowidth = self::interpret_width_attribute( self::get_array_value_with_fallback( $args, 'width' ) );
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 
51 51
 require_once __DIR__ . '/vendor/autoload.php';
52 52
 
53
-register_activation_hook(   __FILE__, array( 'PodloveSubscribeButton\Setup', 'activation' ) );
53
+register_activation_hook( __FILE__, array( 'PodloveSubscribeButton\Setup', 'activation' ) );
54 54
 register_deactivation_hook( __FILE__, array( 'PodloveSubscribeButton\Setup', 'deactivation' ) );
55
-register_uninstall_hook(    __FILE__, array( 'PodloveSubscribeButton\Setup', 'uninstall' ) );
55
+register_uninstall_hook( __FILE__, array( 'PodloveSubscribeButton\Setup', 'uninstall' ) );
56 56
 
57 57
 PodloveSubscribeButton\Migration::eval_db();
58 58
 PodloveSubscribeButton::run();
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		}
102 102
 
103 103
 		// CSS Stylesheet
104
-		wp_register_style( 'podlove-subscribe-button', \PodloveSubscribeButton\Helpers::get_url( '' ) . 'css/style.css' , false, self::$version );
104
+		wp_register_style( 'podlove-subscribe-button', \PodloveSubscribeButton\Helpers::get_url( '' ) . 'css/style.css', false, self::$version );
105 105
 		wp_enqueue_style( 'podlove-subscribe-button' );
106 106
 
107 107
 		// Admin JS
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
 	}
147 147
 
148 148
 	/**
149
-     * Get value from the associative array of the plugin defaults option
150
-     *
149
+	 * Get value from the associative array of the plugin defaults option
150
+	 *
151 151
 	 * @param $key
152 152
 	 * @param bool $default
153 153
 	 *
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		if ( isset( $attribute_value ) && ctype_alnum( $attribute_value ) && key_exists( $attribute_value, \PodloveSubscribeButton\Model\Button::$$attribute ) ) {
234 234
 			return $attribute_value;
235 235
 		} else {
236
-		    $default = get_option( 'podlove_psb_defaults', \PodloveSubscribeButton\Defaults::options() );
236
+			$default = get_option( 'podlove_psb_defaults', \PodloveSubscribeButton\Defaults::options() );
237 237
 			return $default[ $attribute ];
238 238
 		}
239 239
 
Please login to merge, or discard this patch.
inc/Model/Base.php 2 patches
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -45,11 +45,13 @@  discard block
 block discarded – undo
45 45
 	}
46 46
 
47 47
 	private static function unserialize_property( $property ) {
48
-		if ( ! isset( $property ) )
49
-			return;
48
+		if ( ! isset( $property ) ) {
49
+					return;
50
+		}
50 51
 
51
-		if ( $unserialized_string = is_serialized( $property ) )
52
-			return unserialize( $property );
52
+		if ( $unserialized_string = is_serialized( $property ) ) {
53
+					return unserialize( $property );
54
+		}
53 55
 
54 56
 		return $property;
55 57
 	}
@@ -319,8 +321,9 @@  discard block
 block discarded – undo
319 321
 	 */
320 322
 	public function update_attributes( $attributes ) {
321 323
 
322
-		if ( ! is_array( $attributes ) )
323
-			return false;
324
+		if ( ! is_array( $attributes ) ) {
325
+					return false;
326
+		}
324 327
 
325 328
 		$request = filter_input_array( INPUT_POST ); // Do this for security reasons
326 329
 			
@@ -429,12 +432,14 @@  discard block
 block discarded – undo
429 432
 		
430 433
 		$defaults = $this->default_values();
431 434
 
432
-		if ( ! is_array( $defaults ) || empty( $defaults ) )
433
-			return;
435
+		if ( ! is_array( $defaults ) || empty( $defaults ) ) {
436
+					return;
437
+		}
434 438
 
435 439
 		foreach ( $defaults as $property => $value ) {
436
-			if ( $this->$property === null )
437
-				$this->$property = $value;
440
+			if ( $this->$property === null ) {
441
+							$this->$property = $value;
442
+			}
438 443
 		}
439 444
 
440 445
 	}
@@ -495,8 +500,9 @@  discard block
 block discarded – undo
495 500
 		global $wpdb;
496 501
 		
497 502
 		$property_sql = array();
498
-		foreach ( static::properties() as $property )
499
-			$property_sql[ ] = "`{$property[ 'name' ]}` {$property[ 'type' ]}";
503
+		foreach ( static::properties() as $property ) {
504
+					$property_sql[ ] = "`{$property[ 'name' ]}` {$property[ 'type' ]}";
505
+		}
500 506
 		
501 507
 		$sql = 'CREATE TABLE IF NOT EXISTS '
502 508
 		     . static::table_name()
Please login to merge, or discard this patch.
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -396,14 +396,14 @@  discard block
 block discarded – undo
396 396
 			$this->set_defaults();
397 397
 
398 398
 			$sql = 'INSERT INTO '
399
-			     . static::table_name()
400
-			     . ' ( '
401
-			     . implode( ',', static::property_names() )
402
-			     . ' ) '
403
-			     . 'VALUES'
404
-			     . ' ( '
405
-			     . implode( ',', array_map( array( $this, 'property_name_to_sql_value' ), static::property_names() ) )
406
-			     . ' );'
399
+				 . static::table_name()
400
+				 . ' ( '
401
+				 . implode( ',', static::property_names() )
402
+				 . ' ) '
403
+				 . 'VALUES'
404
+				 . ' ( '
405
+				 . implode( ',', array_map( array( $this, 'property_name_to_sql_value' ), static::property_names() ) )
406
+				 . ' );'
407 407
 			;
408 408
 			$success = $wpdb->query( $sql );
409 409
 			if ( $success ) {
@@ -411,9 +411,9 @@  discard block
 block discarded – undo
411 411
 			}
412 412
 		} else {
413 413
 			$sql = 'UPDATE ' . static::table_name()
414
-			     . ' SET '
415
-			     . implode( ',', array_map( array( $this, 'property_name_to_sql_update_statement' ), static::property_names() ) )
416
-			     . ' WHERE id = ' . $this->id
414
+				 . ' SET '
415
+				 . implode( ',', array_map( array( $this, 'property_name_to_sql_update_statement' ), static::property_names() ) )
416
+				 . ' WHERE id = ' . $this->id
417 417
 			;
418 418
 
419 419
 			$success = $wpdb->query( $sql );
@@ -461,13 +461,13 @@  discard block
 block discarded – undo
461 461
 		global $wpdb;
462 462
 
463 463
 		$sql = 'DELETE FROM '
464
-		     . static::table_name()
465
-		     . ' WHERE id = ' . $this->id;
464
+			 . static::table_name()
465
+			 . ' WHERE id = ' . $this->id;
466 466
 
467 467
 		$rows_affected = $wpdb->query( $sql );
468 468
 
469
-	    do_action( 'podlove_psb_model_delete', $this );
470
-	    do_action( 'podlove_psb_model_change', $this );
469
+		do_action( 'podlove_psb_model_delete', $this );
470
+		do_action( 'podlove_psb_model_change', $this );
471 471
 
472 472
 		return $rows_affected !== false;
473 473
 	}
@@ -506,10 +506,10 @@  discard block
 block discarded – undo
506 506
 			$property_sql[ ] = "`{$property[ 'name' ]}` {$property[ 'type' ]}";
507 507
 
508 508
 		$sql = 'CREATE TABLE IF NOT EXISTS '
509
-		     . static::table_name()
510
-		     . ' ('
511
-		     . implode( ',', $property_sql )
512
-		     . ' ) CHARACTER SET utf8;'
509
+			 . static::table_name()
510
+			 . ' ('
511
+			 . implode( ',', $property_sql )
512
+			 . ' ) CHARACTER SET utf8;'
513 513
 		;
514 514
 
515 515
 		$wpdb->query( $sql );
Please login to merge, or discard this patch.
inc/Settings/Buttons.php 3 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,8 +45,9 @@  discard block
 block discarded – undo
45 45
 	 * Process form: save/update a format
46 46
 	 */
47 47
 	public static function save() {
48
-		if ( null == filter_input( INPUT_GET, 'button' ) )
49
-			return;
48
+		if ( null == filter_input( INPUT_GET, 'button' ) ) {
49
+					return;
50
+		}
50 51
 
51 52
 		$post = filter_input_array( INPUT_POST );
52 53
 
@@ -81,8 +82,9 @@  discard block
 block discarded – undo
81 82
 	 * Process form: delete a format
82 83
 	 */
83 84
 	public static function delete() {
84
-		if ( null == filter_input( INPUT_GET, 'button' ) )
85
-			return;
85
+		if ( null == filter_input( INPUT_GET, 'button' ) ) {
86
+					return;
87
+		}
86 88
 
87 89
 		$button = ( filter_input( INPUT_GET, 'network' ) === '1' ? \PodloveSubscribeButton\Model\NetworkButton::find_by_id( filter_input( INPUT_GET, 'button' ) ) : \PodloveSubscribeButton\Model\Button::find_by_id( filter_input( INPUT_GET, 'button' ) ) );
88 90
 		$button->delete();
@@ -104,8 +106,9 @@  discard block
 block discarded – undo
104 106
 	}
105 107
 
106 108
 	public static function process_form() {
107
-		if ( null === filter_input( INPUT_GET, 'button' ) )
108
-			return;
109
+		if ( null === filter_input( INPUT_GET, 'button' ) ) {
110
+					return;
111
+		}
109 112
 
110 113
 		$action = ( null !== filter_input( INPUT_GET, 'action' ) ? filter_input( INPUT_GET, 'action' ) : null );
111 114
 
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
                 <div id="post-body" class="columns-2">
41 41
                     <div id="post-body-content">
42 42
 	                    <?php
43
-	                    switch ( $action ) {
44
-		                    case 'new':   self::new_template(); break;
45
-		                    case 'edit':  self::edit_template(); break;
46
-		                    case 'index': self::view_template(); break;
47
-		                    default:      self::view_template(); break;
48
-	                    }
49
-	                    ?>
43
+						switch ( $action ) {
44
+							case 'new':   self::new_template(); break;
45
+							case 'edit':  self::edit_template(); break;
46
+							case 'index': self::view_template(); break;
47
+							default:      self::view_template(); break;
48
+						}
49
+						?>
50 50
                     </div>
51 51
                     <div id="postbox-container-1" class="postbox-container">
52 52
                         <?php self::sidebar(); ?>
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         </div>
93 93
         <?php
94 94
 
95
-    }
95
+	}
96 96
 
97 97
 	/**
98 98
 	 * Process form: save/update a format
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		$table->display();
203 203
 
204 204
 		if ( $is_network ) {
205
-		    // https://vedovini.net/2015/10/using-the-wordpress-settings-api-with-network-admin-pages/
205
+			// https://vedovini.net/2015/10/using-the-wordpress-settings-api-with-network-admin-pages/
206 206
 			?>
207 207
             <form method="post" action="edit.php?action=podlove_psb_update_network_options">
208 208
 				<?php
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -352,7 +352,7 @@
 block discarded – undo
352 352
 
353 353
 		//Verify Post Referring Page
354 354
 		check_admin_referer( 'podlove-psb-options' );
355
-		update_site_option( 'podlove_psb_defaults', $_POST['podlove_psb_defaults'] );
355
+		update_site_option( 'podlove_psb_defaults', $_POST[ 'podlove_psb_defaults' ] );
356 356
 
357 357
 		//Redirect to Network Settings Page
358 358
 		wp_redirect( add_query_arg( array( 'page' => 'podlove-subscribe-button', 'updated' => 'true' ), network_admin_url( 'settings.php' ) ) );
Please login to merge, or discard this patch.
inc/Button_List_Table.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 namespace PodloveSubscribeButton;
3 3
 
4 4
 if ( ! class_exists( 'WP_List_Table' ) ) {
5
-    require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
5
+	require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
6 6
 }
7 7
 
8 8
 class Button_List_Table extends \WP_List_Table {
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 		);
29 29
 
30 30
 		return sprintf( '%1$s %2$s',
31
-		    /*$1%s*/ $button->title . '<br><code>[podlove-subscribe-button button="' . $button->name . '"]</code>',
32
-		    /*$3%s*/ $this->row_actions( $actions )
31
+			/*$1%s*/ $button->title . '<br><code>[podlove-subscribe-button button="' . $button->name . '"]</code>',
32
+			/*$3%s*/ $this->row_actions( $actions )
33 33
 		);
34 34
 
35 35
 	}
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		parent::__construct( array(
23 23
 			'singular' => 'feed', // singular name of the listed records
24 24
 			'plural'   => 'feeds', // plural name of the listed records
25
-			'ajax'     => false,  // does this table support ajax?
25
+			'ajax'     => false, // does this table support ajax?
26 26
 		) );
27 27
 
28 28
 	}
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 
54 54
 			$preview  = "<div class='podlove-button-preview-container'>";
55 55
 			$preview .= $button->render(
56
-				$options['size'],
57
-				$options['autowidth'],
58
-				$options['style'],
59
-				$options['format'],
60
-				$options['color'],
56
+				$options[ 'size' ],
57
+				$options[ 'autowidth' ],
58
+				$options[ 'style' ],
59
+				$options[ 'format' ],
60
+				$options[ 'color' ],
61 61
 				false,
62 62
 				false,
63
-				$options['language']
63
+				$options[ 'language' ]
64 64
 			);
65 65
 			$preview .= "</div>";
66 66
 
Please login to merge, or discard this patch.
inc/Widget.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,9 +104,11 @@
 block discarded – undo
104 104
 							echo "<option value='" . $subscribebutton->name . "' " . selected( $subscribebutton->name, $button ) . " >" . $subscribebutton->title . " (" . $subscribebutton->name . ")</option>";
105 105
 						} ?>
106 106
                     </optgroup>
107
-				<?php else :
107
+				<?php else {
108
+	:
108 109
 					foreach ( $buttons as $subscribebutton ) {
109 110
 						echo "<option value='" . $subscribebutton->name . "' " . selected( $subscribebutton->name, $button ) . " >" . $subscribebutton->title . " (" . $subscribebutton->name . ")</option>";
111
+}
110 112
 					}
111 113
 				endif; ?>
112 114
             </select>
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 		'autowidth',
22 22
 		'button',
23 23
 		'color',
24
-        'language'
24
+		'language'
25 25
 	);
26 26
 
27 27
 	public function __construct() {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 			\PodloveSubscribeButton::get_array_value_with_fallback( $instance, 'format' ),
50 50
 			\PodloveSubscribeButton::get_array_value_with_fallback( $instance, 'color' ),
51 51
 			false,
52
-            false,
52
+			false,
53 53
 			\PodloveSubscribeButton::get_array_value_with_fallback( $instance, 'language' )
54 54
 		);
55 55
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 		parent::__construct(
29 29
 			'podlove_subscribe_button_wp_plugin_widget',
30 30
 			( Helpers::is_podlove_publisher_active() ? 'Podlove Subscribe Button (WordPress plugin)' : 'Podlove Subscribe Button' ),
31
-			array( 'description' => __( 'Adds a Podlove Subscribe Button to your Sidebar', 'podlove-subscribe-button' ), )
31
+			array( 'description' => __( 'Adds a Podlove Subscribe Button to your Sidebar', 'podlove-subscribe-button' ),)
32 32
 		);
33 33
 
34 34
 	}
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	public function widget( $args, $instance ) {
37 37
 		// Fetch the (network)button by it's name
38 38
 		if ( ! $button = Model\Button::get_button_by_name( $instance[ 'button' ] ) ) {
39
-			return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args['button'] );
39
+			return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args[ 'button' ] );
40 40
 		}
41 41
 
42 42
 		echo $args[ 'before_widget' ];
@@ -64,15 +64,15 @@  discard block
 block discarded – undo
64 64
 	public function form( $instance ) {
65 65
 		$options = get_option( 'podlove_psb_defaults' );
66 66
 
67
-		$title     = isset( $instance[ 'title' ] )     ? $instance[ 'title' ]     : '';
68
-		$button    = isset( $instance[ 'button' ] )    ? $instance[ 'button' ]    : '';
69
-		$size      = isset( $instance[ 'size' ] )      ? $instance[ 'size' ]      : $options['size'];
70
-		$style     = isset( $instance[ 'style' ] )     ? $instance[ 'style' ]     : $options['style'];
71
-		$format    = isset( $instance[ 'format' ] )    ? $instance[ 'format' ]    : $options['format'];
67
+		$title     = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : '';
68
+		$button    = isset( $instance[ 'button' ] ) ? $instance[ 'button' ] : '';
69
+		$size      = isset( $instance[ 'size' ] ) ? $instance[ 'size' ] : $options[ 'size' ];
70
+		$style     = isset( $instance[ 'style' ] ) ? $instance[ 'style' ] : $options[ 'style' ];
71
+		$format    = isset( $instance[ 'format' ] ) ? $instance[ 'format' ] : $options[ 'format' ];
72 72
 		$autowidth = isset( $instance[ 'autowidth' ] ) ? $instance[ 'autowidth' ] : true;
73
-		$infotext  = isset( $instance[ 'infotext' ] )  ? $instance[ 'infotext' ]  : '';
74
-		$color     = isset( $instance[ 'color' ] )     ? $instance[ 'color' ]     : $options['color'];
75
-		$language  = isset( $instance[ 'language' ] )  ? $instance[ 'language' ]  : $options['language'];
73
+		$infotext  = isset( $instance[ 'infotext' ] ) ? $instance[ 'infotext' ] : '';
74
+		$color     = isset( $instance[ 'color' ] ) ? $instance[ 'color' ] : $options[ 'color' ];
75
+		$language  = isset( $instance[ 'language' ] ) ? $instance[ 'language' ] : $options[ 'language' ];
76 76
 
77 77
 		$buttons = Model\Button::all();
78 78
 		if ( is_multisite() ) {
Please login to merge, or discard this patch.
inc/Defaults.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 			'big'    => __( 'Big', 'podlove-subscribe-button' ),
36 36
 		);
37 37
 
38
-		$language = array( 'de', 'en', 'eo', 'fi', 'fr', 'nl', 'zh', 'ja', );
38
+		$language = array( 'de', 'en', 'eo', 'fi', 'fr', 'nl', 'zh', 'ja',);
39 39
 
40 40
 		return $$property;
41 41
 
Please login to merge, or discard this patch.
inc/Helpers.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
 namespace PodloveSubscribeButton;
10 10
 
11
-Class Helpers {
11
+class Helpers {
12 12
 
13 13
 	public static function get_path( $folder = '' ) {
14 14
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
 			$language = get_option( 'WPLANG' );
69 69
 		}
70 70
 
71
-		$lang_code = strtolower( explode( '_', $language )[0] );
71
+		$lang_code = strtolower( explode( '_', $language )[ 0 ] );
72 72
 
73 73
 		if ( in_array( $lang_code, \PodloveSubscribeButton\Defaults::button( 'language' ) ) ) {
74 74
 			return $lang_code;
Please login to merge, or discard this patch.
inc/Model/Button.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -97,19 +97,19 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	private function get_feeds_as_array( $feeds = array() ) {
99 99
 		foreach ( $feeds as $feed ) {
100
-			if ( isset( Defaults::media_types()[ $feed['format'] ]['extension'] ) ) {
100
+			if ( isset( Defaults::media_types()[ $feed[ 'format' ] ][ 'extension' ] ) ) {
101 101
 				$new_feed = array(
102 102
 					'type'    => 'audio',
103
-					'format'  => Defaults::media_types()[ $feed['format'] ]['extension'],
104
-					'url'     => $feed['url'],
103
+					'format'  => Defaults::media_types()[ $feed[ 'format' ] ][ 'extension' ],
104
+					'url'     => $feed[ 'url' ],
105 105
 					'variant' => 'high',
106 106
 				);
107 107
 
108
-				if ( isset( $feed['itunesfeedid'] ) && $feed['itunesfeedid'] > 0 ) {
109
-					$new_feed['directory-url-itunes'] = "https://itunes.apple.com/podcast/id" . $feed['itunesfeedid'];
108
+				if ( isset( $feed[ 'itunesfeedid' ] ) && $feed[ 'itunesfeedid' ] > 0 ) {
109
+					$new_feed[ 'directory-url-itunes' ] = "https://itunes.apple.com/podcast/id" . $feed[ 'itunesfeedid' ];
110 110
 				}
111 111
 
112
-				$feeds[] = $new_feed;
112
+				$feeds[ ] = $new_feed;
113 113
 
114 114
 			}
115 115
 		}
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
 
159 159
 		return array(
160 160
 			// $attribute => $value
161
-			'size'      => ( $size == 'default' ? $options['size'] : $size ) . self::interpret_autowidth_attribute( $autowidth ),
162
-			'style'     => ( $style == 'default' ? $options['style'] : $style ),
163
-			'format'    => ( $format == 'default' ? $options['format'] : $format ),
164
-			'color'     => ( isset( $color ) ? $color : $options['color'] ),
161
+			'size'      => ( $size == 'default' ? $options[ 'size' ] : $size ) . self::interpret_autowidth_attribute( $autowidth ),
162
+			'style'     => ( $style == 'default' ? $options[ 'style' ] : $style ),
163
+			'format'    => ( $format == 'default' ? $options[ 'format' ] : $format ),
164
+			'color'     => ( isset( $color ) ? $color : $options[ 'color' ] ),
165 165
 			'json-data' => 'podcastData' . $this->id
166 166
 		);
167 167
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 * @return string
174 174
 	 */
175 175
 	private static function interpret_autowidth_attribute( $autowidth ) {
176
-		if ( $autowidth == 'default' && get_option( 'podlove_psb_defaults' )['autowidth'] !== 'on' )
176
+		if ( $autowidth == 'default' && get_option( 'podlove_psb_defaults' )[ 'autowidth' ] !== 'on' )
177 177
 			return '';
178 178
 
179 179
 		if ( $autowidth !== 'default' && $autowidth !== 'on' )
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -173,11 +173,13 @@
 block discarded – undo
173 173
 	 * @return string
174 174
 	 */
175 175
 	private static function interpret_autowidth_attribute( $autowidth ) {
176
-		if ( $autowidth == 'default' && get_option( 'podlove_psb_defaults' )['autowidth'] !== 'on' )
177
-			return '';
176
+		if ( $autowidth == 'default' && get_option( 'podlove_psb_defaults' )['autowidth'] !== 'on' ) {
177
+					return '';
178
+		}
178 179
 
179
-		if ( $autowidth !== 'default' && $autowidth !== 'on' )
180
-			return '';
180
+		if ( $autowidth !== 'default' && $autowidth !== 'on' ) {
181
+					return '';
182
+		}
181 183
 
182 184
 		return ' auto';
183 185
 
Please login to merge, or discard this patch.
inc/Options.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -152,11 +152,11 @@
 block discarded – undo
152 152
 
153 153
 	public static function sanitize_settings( $input = null ) {
154 154
 
155
-	    $output = $input;
155
+		$output = $input;
156 156
 
157
-	    if ( ! array_key_exists('autowidth', $input ) ) {
158
-		    $output['autowidth'] = 'off';
159
-        }
157
+		if ( ! array_key_exists('autowidth', $input ) ) {
158
+			$output['autowidth'] = 'off';
159
+		}
160 160
 
161 161
 		return $output;
162 162
 	}
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -112,18 +112,18 @@  discard block
 block discarded – undo
112 112
 			$option = get_option( 'podlove_psb_defaults' );
113 113
 		}
114 114
 
115
-		switch ( $args['type'] ) {
115
+		switch ( $args[ 'type' ] ) {
116 116
 			case 'checkbox':
117 117
 				?>
118
-                <input type="checkbox" name="<?php echo "podlove_psb_defaults[{$args['label_for']}]"; ?>"
119
-                       id="<?php echo "podlove_psb_defaults[{$args['label_for']}]"; ?>" <?php checked( $option[ $args['label_for'] ], 'on' ); ?> />
118
+                <input type="checkbox" name="<?php echo "podlove_psb_defaults[{$args[ 'label_for' ]}]"; ?>"
119
+                       id="<?php echo "podlove_psb_defaults[{$args[ 'label_for' ]}]"; ?>" <?php checked( $option[ $args[ 'label_for' ] ], 'on' ); ?> />
120 120
 				<?php
121 121
 				break;
122 122
 
123 123
 			case 'color':
124 124
 				?>
125 125
                 <input id="podlove_psb_defaults[color]" name="podlove_psb_defaults[color]" class="podlove_subscribe_button_color"
126
-                       value="<?php echo $option['color'] ?>"/>
126
+                       value="<?php echo $option[ 'color' ] ?>"/>
127 127
 				<?php
128 128
 				break;
129 129
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 				?>
132 132
                 <select name="podlove_psb_defaults[language]" id="podlove_psb_defaults[language]">
133 133
 					<?php foreach ( Defaults::button( 'language' ) as $value ) : ?>
134
-                        <option value="<?php echo $value; ?>" <?php selected( $option['language'], $value ); ?>><?php echo $value; ?></option>
134
+                        <option value="<?php echo $value; ?>" <?php selected( $option[ 'language' ], $value ); ?>><?php echo $value; ?></option>
135 135
 					<?php endforeach; ?>
136 136
                 </select>
137 137
 				<?php
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 
141 141
 			case 'select':
142 142
 				?>
143
-                <select name="podlove_psb_defaults[<?php echo $args['label_for']; ?>]" id="podlove_psb_defaults[<?php echo $args['label_for']; ?>]">
144
-					<?php foreach ( Defaults::button( $args['label_for'] ) as $value => $description ) { ?>
145
-                        <option value="<?php echo $value; ?>" <?php selected( $option[ $args['label_for'] ], $value ); ?>><?php echo $description; ?></option>
143
+                <select name="podlove_psb_defaults[<?php echo $args[ 'label_for' ]; ?>]" id="podlove_psb_defaults[<?php echo $args[ 'label_for' ]; ?>]">
144
+					<?php foreach ( Defaults::button( $args[ 'label_for' ] ) as $value => $description ) { ?>
145
+                        <option value="<?php echo $value; ?>" <?php selected( $option[ $args[ 'label_for' ] ], $value ); ?>><?php echo $description; ?></option>
146 146
 					<?php } ?>
147 147
                 </select>
148 148
 				<?php break;
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
 
155 155
 	    $output = $input;
156 156
 
157
-	    if ( ! array_key_exists('autowidth', $input ) ) {
158
-		    $output['autowidth'] = 'off';
157
+	    if ( ! array_key_exists( 'autowidth', $input ) ) {
158
+		    $output[ 'autowidth' ] = 'off';
159 159
         }
160 160
 
161 161
 		return $output;
Please login to merge, or discard this patch.