Passed
Push — develop ( 33219b...70059d )
by Remco
04:24
created
classes/Admin/SubscriptionPostType.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	public function __construct() {
30 30
 		add_filter( 'request', array( $this, 'request' ) );
31 31
 
32
-		add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'columns' ) );
33
-		add_filter( 'manage_edit-' . self::POST_TYPE . '_sortable_columns', array( $this, 'sortable_columns' ) );
32
+		add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'columns' ) );
33
+		add_filter( 'manage_edit-'.self::POST_TYPE.'_sortable_columns', array( $this, 'sortable_columns' ) );
34 34
 
35
-		add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
35
+		add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
36 36
 
37 37
 		add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
38 38
 
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
 		$screen = get_current_screen();
55 55
 
56 56
 		if ( self::POST_TYPE === $screen->post_type ) {
57
-			if ( ! isset( $vars['post_status'] ) ) {
58
-				$vars['post_status'] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_subscription_states() );
57
+			if ( !isset( $vars[ 'post_status' ] ) ) {
58
+				$vars[ 'post_status' ] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_subscription_states() );
59 59
 
60
-				$vars['post_status'][] = 'publish';
60
+				$vars[ 'post_status' ][ ] = 'publish';
61 61
 			}
62 62
 		}
63 63
 
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
 	 * @return array
96 96
 	 */
97 97
 	public function sortable_columns( $sortable_columns ) {
98
-		$sortable_columns['pronamic_subscription_title'] = 'ID';
99
-		$sortable_columns['pronamic_subscription_date']  = 'date';
98
+		$sortable_columns[ 'pronamic_subscription_title' ] = 'ID';
99
+		$sortable_columns[ 'pronamic_subscription_date' ]  = 'date';
100 100
 
101 101
 		return $sortable_columns;
102 102
 	}
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 				$source_id          = $subscription->get_source_id();
140 140
 				$source_description = $subscription->get_source_description();
141 141
 
142
-				$source_id_text = '#' . $source_id;
142
+				$source_id_text = '#'.$source_id;
143 143
 
144 144
 				$source_link = $subscription->get_source_link();
145 145
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 					$config_id = get_post_meta( $payment->get_id(), '_pronamic_payment_config_id', true );
180 180
 				}
181 181
 
182
-				if ( isset( $config_id ) && ! empty( $config_id ) ) {
182
+				if ( isset( $config_id ) && !empty( $config_id ) ) {
183 183
 					echo get_the_title( $config_id );
184 184
 				} else {
185 185
 					echo '—';
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 	 * @param WP_Post $post The object for the current post/page.
302 302
 	 */
303 303
 	public function meta_box_info( $post ) {
304
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-subscription-info.php';
304
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-subscription-info.php';
305 305
 	}
306 306
 
307 307
 	/**
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 	 * @param WP_Post $post The object for the current post/page.
311 311
 	 */
312 312
 	public function meta_box_log( $post ) {
313
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-subscription-log.php';
313
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-subscription-log.php';
314 314
 	}
315 315
 
316 316
 	/**
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	 * @param WP_Post $post The object for the current post/page.
320 320
 	 */
321 321
 	public function meta_box_payments( $post ) {
322
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-subscription-payments.php';
322
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-subscription-payments.php';
323 323
 	}
324 324
 
325 325
 	/**
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	public function meta_box_update( $post ) {
331 331
 		wp_nonce_field( 'pronamic_subscription_update', 'pronamic_subscription_update_nonce' );
332 332
 
333
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-subscription-update.php';
333
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-subscription-update.php';
334 334
 	}
335 335
 
336 336
 	/**
@@ -405,8 +405,8 @@  discard block
 block discarded – undo
405 405
 			add_action( 'transition_post_status', array( $this, 'transition_post_status' ), 10, 3 );
406 406
 
407 407
 			// Do subscription status update actions.
408
-			do_action( 'pronamic_subscription_status_update_' . $subscription->source . '_' . strtolower( $old_status_meta ) . '_to_' . strtolower( $new_status_meta ), $subscription, $can_redirect );
409
-			do_action( 'pronamic_subscription_status_update_' . $subscription->source, $subscription, $can_redirect );
408
+			do_action( 'pronamic_subscription_status_update_'.$subscription->source.'_'.strtolower( $old_status_meta ).'_to_'.strtolower( $new_status_meta ), $subscription, $can_redirect );
409
+			do_action( 'pronamic_subscription_status_update_'.$subscription->source, $subscription, $can_redirect );
410 410
 			do_action( 'pronamic_subscription_status_update', $subscription, $can_redirect );
411 411
 		}
412 412
 	}
Please login to merge, or discard this patch.
classes/Admin/AdminModule.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		// Gateway settings.
70 70
 		$this->gateway_settings = new GatewaySettings();
71 71
 
72
-		if ( ! wp_next_scheduled( 'pronamic_pay_license_check' ) ) {
72
+		if ( !wp_next_scheduled( 'pronamic_pay_license_check' ) ) {
73 73
 			wp_schedule_event( time(), 'daily', 'pronamic_pay_license_check' );
74 74
 		}
75 75
 	}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 				||
96 96
 			filter_has_var( INPUT_GET, 'activate-multi' )
97 97
 				||
98
-			! current_user_can( 'manage_options' )
98
+			!current_user_can( 'manage_options' )
99 99
 		) {
100 100
 			return;
101 101
 		}
@@ -126,12 +126,12 @@  discard block
 block discarded – undo
126 126
 
127 127
 		$args = wp_parse_args( $args, $defaults );
128 128
 
129
-		$id    = $args['label_for'];
129
+		$id    = $args[ 'label_for' ];
130 130
 		$value = get_option( $id );
131 131
 
132 132
 		$legend = sprintf(
133 133
 			'<legend class="screen-reader-text"><span>%s</span></legend>',
134
-			esc_html( $args['label'] )
134
+			esc_html( $args[ 'label' ] )
135 135
 		);
136 136
 
137 137
 		$input = sprintf(
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 			'<label for="%s">%s %s</label>',
148 148
 			esc_attr( $id ),
149 149
 			$input,
150
-			esc_html( $args['label'] )
150
+			esc_html( $args[ 'label' ] )
151 151
 		);
152 152
 
153 153
 		printf( // WPCS: XSS ok.
@@ -187,9 +187,9 @@  discard block
 block discarded – undo
187 187
 		$output = '';
188 188
 
189 189
 		// Dropdown.
190
-		$id       = $args['name'];
191
-		$name     = $args['name'];
192
-		$selected = $args['selected'];
190
+		$id       = $args[ 'name' ];
191
+		$name     = $args[ 'name' ];
192
+		$selected = $args[ 'selected' ];
193 193
 
194 194
 		if ( false === $selected ) {
195 195
 			$selected = get_option( $id );
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			esc_attr( $name )
202 202
 		);
203 203
 
204
-		$options = \Pronamic\WordPress\Pay\Plugin::get_config_select_options( $args['payment_method'] );
204
+		$options = \Pronamic\WordPress\Pay\Plugin::get_config_select_options( $args[ 'payment_method' ] );
205 205
 
206 206
 		foreach ( $options as $value => $name ) {
207 207
 			$output .= sprintf(
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 		$output .= sprintf( '</select>' );
216 216
 
217 217
 		// Return or echo.
218
-		if ( $args['echo'] ) {
218
+		if ( $args[ 'echo' ] ) {
219 219
 			echo $output; // WPCS: XSS ok.
220 220
 		} else {
221 221
 			return $output;
@@ -231,33 +231,33 @@  discard block
 block discarded – undo
231 231
 	private function create_pages( $pages, $parent = null ) {
232 232
 		foreach ( $pages as $page ) {
233 233
 			$post = array(
234
-				'post_title'     => $page['post_title'],
235
-				'post_name'      => $page['post_title'],
236
-				'post_content'   => $page['post_content'],
234
+				'post_title'     => $page[ 'post_title' ],
235
+				'post_name'      => $page[ 'post_title' ],
236
+				'post_content'   => $page[ 'post_content' ],
237 237
 				'post_status'    => 'publish',
238 238
 				'post_type'      => 'page',
239 239
 				'comment_status' => 'closed',
240 240
 			);
241 241
 
242 242
 			if ( isset( $parent ) ) {
243
-				$post['post_parent'] = $parent;
243
+				$post[ 'post_parent' ] = $parent;
244 244
 			}
245 245
 
246 246
 			$result = wp_insert_post( $post, true );
247 247
 
248
-			if ( ! is_wp_error( $result ) ) {
249
-				if ( isset( $page['post_meta'] ) ) {
250
-					foreach ( $page['post_meta'] as $key => $value ) {
248
+			if ( !is_wp_error( $result ) ) {
249
+				if ( isset( $page[ 'post_meta' ] ) ) {
250
+					foreach ( $page[ 'post_meta' ] as $key => $value ) {
251 251
 						update_post_meta( $result, $key, $value );
252 252
 					}
253 253
 				}
254 254
 
255
-				if ( isset( $page['option_name'] ) ) {
256
-					update_option( $page['option_name'], $result );
255
+				if ( isset( $page[ 'option_name' ] ) ) {
256
+					update_option( $page[ 'option_name' ], $result );
257 257
 				}
258 258
 
259
-				if ( isset( $page['children'] ) ) {
260
-					$this->create_pages( $page['children'], $result );
259
+				if ( isset( $page[ 'children' ] ) ) {
260
+					$this->create_pages( $page[ 'children' ], $result );
261 261
 				}
262 262
 			}
263 263
 		}
@@ -267,11 +267,11 @@  discard block
 block discarded – undo
267 267
 	 * Maybe create pages.
268 268
 	 */
269 269
 	public function maybe_create_pages() {
270
-		if ( ! filter_has_var( INPUT_POST, 'pronamic_pay_create_pages' ) ) {
270
+		if ( !filter_has_var( INPUT_POST, 'pronamic_pay_create_pages' ) ) {
271 271
 			return;
272 272
 		}
273 273
 
274
-		if ( ! check_admin_referer( 'pronamic_pay_settings', 'pronamic_pay_nonce' ) ) {
274
+		if ( !check_admin_referer( 'pronamic_pay_settings', 'pronamic_pay_nonce' ) ) {
275 275
 			return;
276 276
 		}
277 277
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 			// Tippy.js - https://atomiks.github.io/tippyjs/.
377 377
 			wp_register_script(
378 378
 				'tippy.js',
379
-				plugins_url( 'assets/tippy.js/tippy.all' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ),
379
+				plugins_url( 'assets/tippy.js/tippy.all'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ),
380 380
 				array(),
381 381
 				'2.2.3',
382 382
 				true
@@ -392,14 +392,14 @@  discard block
 block discarded – undo
392 392
 
393 393
 			wp_register_style(
394 394
 				'pronamic-pay-admin',
395
-				plugins_url( 'css/admin' . $min . '.css', \Pronamic\WordPress\Pay\Plugin::$file ),
395
+				plugins_url( 'css/admin'.$min.'.css', \Pronamic\WordPress\Pay\Plugin::$file ),
396 396
 				array( 'pronamic-pay-icons' ),
397 397
 				$this->plugin->get_version()
398 398
 			);
399 399
 
400 400
 			wp_register_script(
401 401
 				'pronamic-pay-admin',
402
-				plugins_url( 'js/admin' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ),
402
+				plugins_url( 'js/admin'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ),
403 403
 				array( 'jquery', 'tippy.js' ),
404 404
 				$this->plugin->get_version(),
405 405
 				true
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 
468 468
 		add_menu_page(
469 469
 			__( 'Pronamic Pay', 'pronamic_ideal' ),
470
-			__( 'Pay', 'pronamic_ideal' ) . $badge,
470
+			__( 'Pay', 'pronamic_ideal' ).$badge,
471 471
 			'edit_payments',
472 472
 			'pronamic_ideal',
473 473
 			array( $this, 'page_dashboard' ),
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 		add_submenu_page(
478 478
 			'pronamic_ideal',
479 479
 			__( 'Payments', 'pronamic_ideal' ),
480
-			__( 'Payments', 'pronamic_ideal' ) . $badge,
480
+			__( 'Payments', 'pronamic_ideal' ).$badge,
481 481
 			'edit_payments',
482 482
 			'edit.php?post_type=pronamic_payment'
483 483
 		);
@@ -528,8 +528,8 @@  discard block
 block discarded – undo
528 528
 
529 529
 		global $submenu;
530 530
 
531
-		if ( isset( $submenu['pronamic_ideal'] ) ) {
532
-			$submenu['pronamic_ideal'][0][0] = __( 'Dashboard', 'pronamic_ideal' ); // WPCS: override ok.
531
+		if ( isset( $submenu[ 'pronamic_ideal' ] ) ) {
532
+			$submenu[ 'pronamic_ideal' ][ 0 ][ 0 ] = __( 'Dashboard', 'pronamic_ideal' ); // WPCS: override ok.
533 533
 		}
534 534
 	}
535 535
 
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 	public function render_page( $name ) {
564 564
 		$result = false;
565 565
 
566
-		$file = plugin_dir_path( \Pronamic\WordPress\Pay\Plugin::$file ) . 'admin/page-' . $name . '.php';
566
+		$file = plugin_dir_path( \Pronamic\WordPress\Pay\Plugin::$file ).'admin/page-'.$name.'.php';
567 567
 
568 568
 		if ( is_readable( $file ) ) {
569 569
 			include $file;
Please login to merge, or discard this patch.
classes/Admin/PaymentBulkActions.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	public function load() {
33 33
 		// Current user.
34
-		if ( ! current_user_can( 'edit_payments' ) ) {
34
+		if ( !current_user_can( 'edit_payments' ) ) {
35 35
 			return;
36 36
 		}
37 37
 
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 		}
44 44
 
45 45
 		// Bulk actions.
46
-		add_filter( 'bulk_actions-' . $screen->id, array( $this, 'bulk_actions' ) );
46
+		add_filter( 'bulk_actions-'.$screen->id, array( $this, 'bulk_actions' ) );
47 47
 
48
-		add_filter( 'handle_bulk_actions-' . $screen->id, array( $this, 'handle_bulk_action' ), 10, 3 );
48
+		add_filter( 'handle_bulk_actions-'.$screen->id, array( $this, 'handle_bulk_action' ), 10, 3 );
49 49
 
50 50
 		// Admin notices.
51 51
 		add_action( 'admin_notices', array( $this, 'admin_notices' ) );
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public function bulk_actions( $bulk_actions ) {
63 63
 		// Don't allow edit in bulk.
64
-		unset( $bulk_actions['edit'] );
64
+		unset( $bulk_actions[ 'edit' ] );
65 65
 
66 66
 		// Bulk check payment status.
67
-		$bulk_actions['pronamic_payment_check_status'] = __( 'Check Payment Status', 'pronamic_ideal' );
67
+		$bulk_actions[ 'pronamic_payment_check_status' ] = __( 'Check Payment Status', 'pronamic_ideal' );
68 68
 
69 69
 		return $bulk_actions;
70 70
 	}
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
 			// Make sure gateway supports `payment_status_request` feature.
103 103
 			$config_id = $payment->config_id;
104 104
 
105
-			if ( ! isset( $gateways[ $config_id ] ) ) {
105
+			if ( !isset( $gateways[ $config_id ] ) ) {
106 106
 				$gateways[ $config_id ] = \Pronamic\WordPress\Pay\Plugin::get_gateway( $config_id );
107 107
 
108
-				if ( $gateways[ $config_id ] && ! $gateways[ $config_id ]->supports( 'payment_status_request' ) ) {
109
-					$unsupported_gateways[] = $config_id;
108
+				if ( $gateways[ $config_id ] && !$gateways[ $config_id ]->supports( 'payment_status_request' ) ) {
109
+					$unsupported_gateways[ ] = $config_id;
110 110
 				}
111 111
 			}
112 112
 
Please login to merge, or discard this patch.
classes/Admin/AdminAboutPage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 				array( $this, 'page_about' )
69 69
 			);
70 70
 
71
-			add_action( 'admin_print_styles-' . $hook_suffix, array( $this, 'admin_css' ) );
71
+			add_action( 'admin_print_styles-'.$hook_suffix, array( $this, 'admin_css' ) );
72 72
 		}
73 73
 	}
74 74
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 		wp_enqueue_style(
89 89
 			'proanmic-pay-admin-about',
90
-			plugins_url( 'css/admin-about' . $min . '.css', Plugin::$file ),
90
+			plugins_url( 'css/admin-about'.$min.'.css', Plugin::$file ),
91 91
 			array(),
92 92
 			$this->plugin->get_version()
93 93
 		);
Please login to merge, or discard this patch.
classes/Admin/AdminNotices.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		$screen = get_current_screen();
44 44
 
45 45
 		// Show notices only to options managers (administrators).
46
-		if ( ! current_user_can( 'manage_options' ) ) {
46
+		if ( !current_user_can( 'manage_options' ) ) {
47 47
 			return;
48 48
 		}
49 49
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		$notices = get_option( 'pronamic_pay_admin_notices', array() );
85 85
 
86 86
 		foreach ( $notices as $name ) {
87
-			$file = plugin_dir_path( \Pronamic\WordPress\Pay\Plugin::$file ) . 'admin/notice-' . $name . '.php';
87
+			$file = plugin_dir_path( \Pronamic\WordPress\Pay\Plugin::$file ).'admin/notice-'.$name.'.php';
88 88
 
89 89
 			if ( is_readable( $file ) ) {
90 90
 				include $file;
Please login to merge, or discard this patch.
classes/Admin/AdminDashboard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,6 +76,6 @@
 block discarded – undo
76 76
 			), admin_url( 'edit.php' )
77 77
 		);
78 78
 
79
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/widget-payments-status-list.php';
79
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/widget-payments-status-list.php';
80 80
 	}
81 81
 }
Please login to merge, or discard this patch.
classes/Admin/AdminSettings.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 * @param array $args Arguments.
168 168
 	 */
169 169
 	public function settings_section( $args ) {
170
-		switch ( $args['id'] ) {
170
+		switch ( $args[ 'id' ] ) {
171 171
 			case 'pronamic_pay_pages':
172 172
 				echo '<p>';
173 173
 				esc_html_e( 'The page an user will get redirected to after payment, based on the payment status.', 'pronamic_ideal' );
@@ -180,12 +180,12 @@  discard block
 block discarded – undo
180 180
 
181 181
 					$option = get_option( $option_name );
182 182
 
183
-					if ( ! empty( $option ) ) {
183
+					if ( !empty( $option ) ) {
184 184
 						$hide_button = true;
185 185
 					}
186 186
 				}
187 187
 
188
-				if ( ! isset( $hide_button ) ) {
188
+				if ( !isset( $hide_button ) ) {
189 189
 					submit_button(
190 190
 						__( 'Set default pages', 'pronamic_ideal' ),
191 191
 						'',
@@ -212,14 +212,14 @@  discard block
 block discarded – undo
212 212
 
213 213
 		$args = wp_parse_args( $args, $defaults );
214 214
 
215
-		$name  = $args['label_for'];
215
+		$name  = $args[ 'label_for' ];
216 216
 		$value = get_option( $name );
217 217
 
218 218
 		$atts = array(
219 219
 			'name'  => $name,
220 220
 			'id'    => $name,
221
-			'type'  => $args['type'],
222
-			'class' => $args['classes'],
221
+			'type'  => $args[ 'type' ],
222
+			'class' => $args[ 'classes' ],
223 223
 			'value' => $value,
224 224
 		);
225 225
 
@@ -230,10 +230,10 @@  discard block
 block discarded – undo
230 230
 			// @codingStandardsIgnoreEn
231 231
 		);
232 232
 
233
-		if ( ! empty( $args['description'] ) ) {
233
+		if ( !empty( $args[ 'description' ] ) ) {
234 234
 			printf(
235 235
 				'<p class="description">%s</p>',
236
-				esc_html( $args['description'] )
236
+				esc_html( $args[ 'description' ] )
237 237
 			);
238 238
 		}
239 239
 	}
@@ -246,10 +246,10 @@  discard block
 block discarded – undo
246 246
 	 * @param array $args Arguments.
247 247
 	 */
248 248
 	public function input_checkbox( $args ) {
249
-		$id     = $args['label_for'];
250
-		$name   = $args['label_for'];
249
+		$id     = $args[ 'label_for' ];
250
+		$name   = $args[ 'label_for' ];
251 251
 		$value  = get_option( $name );
252
-		$legend = $args['legend'];
252
+		$legend = $args[ 'legend' ];
253 253
 
254 254
 		echo '<fieldset>';
255 255
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 			checked( $value, 1, false )
271 271
 		);
272 272
 
273
-		echo esc_html( $args['description'] );
273
+		echo esc_html( $args[ 'description' ] );
274 274
 
275 275
 		echo '</label>';
276 276
 
@@ -300,13 +300,13 @@  discard block
 block discarded – undo
300 300
 	 * @param array $args Arguments.
301 301
 	 */
302 302
 	public function input_page( $args ) {
303
-		$name = $args['label_for'];
303
+		$name = $args[ 'label_for' ];
304 304
 
305 305
 		wp_dropdown_pages( array(
306 306
 			'name'             => esc_attr( $name ),
307
-			'post_type'        => esc_attr( isset( $args['post_type'] ) ? $args['post_type'] : 'page' ),
307
+			'post_type'        => esc_attr( isset( $args[ 'post_type' ] ) ? $args[ 'post_type' ] : 'page' ),
308 308
 			'selected'         => esc_attr( get_option( $name, '' ) ),
309
-			'show_option_none' => esc_attr( isset( $args['show_option_none'] ) ? $args['show_option_none'] : __( '— Select a page —', 'pronamic_ideal' ) ),
309
+			'show_option_none' => esc_attr( isset( $args[ 'show_option_none' ] ) ? $args[ 'show_option_none' ] : __( '— Select a page —', 'pronamic_ideal' ) ),
310 310
 			'class'            => 'regular-text',
311 311
 		) );
312 312
 	}
Please login to merge, or discard this patch.
classes/Admin/AdminReports.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		);
63 63
 
64 64
 		// @see https://github.com/WordPress/WordPress/blob/4.2.4/wp-admin/admin-header.php#L82-L87.
65
-		add_action( 'admin_print_styles-' . $hook_suffix, array( $this, 'admin_css' ) );
65
+		add_action( 'admin_print_styles-'.$hook_suffix, array( $this, 'admin_css' ) );
66 66
 	}
67 67
 
68 68
 	/**
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
 		wp_register_script(
85 85
 			'flot',
86
-			plugins_url( 'assets/flot/jquery.flot' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ),
86
+			plugins_url( 'assets/flot/jquery.flot'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ),
87 87
 			array( 'jquery' ),
88 88
 			$flot_version,
89 89
 			true
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 		wp_register_script(
93 93
 			'flot-time',
94
-			plugins_url( 'assets/flot/jquery.flot.time' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ),
94
+			plugins_url( 'assets/flot/jquery.flot.time'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ),
95 95
 			array( 'flot' ),
96 96
 			$flot_version,
97 97
 			true
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 		wp_register_script(
101 101
 			'flot-resize',
102
-			plugins_url( 'assets/flot/jquery.flot.resize' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ),
102
+			plugins_url( 'assets/flot/jquery.flot.resize'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ),
103 103
 			array( 'flot' ),
104 104
 			$flot_version,
105 105
 			true
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 		// Accounting.js - http://openexchangerates.github.io/accounting.js.
109 109
 		wp_register_script(
110 110
 			'accounting',
111
-			plugins_url( 'assets/accounting/accounting' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ),
111
+			plugins_url( 'assets/accounting/accounting'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ),
112 112
 			array( 'jquery' ),
113 113
 			'0.4.1',
114 114
 			true
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		// Reports.
118 118
 		wp_register_script(
119 119
 			'proanmic-pay-admin-reports',
120
-			plugins_url( 'js/admin-reports' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ),
120
+			plugins_url( 'js/admin-reports'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ),
121 121
 			array(
122 122
 				'jquery',
123 123
 				'flot',
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 				$value = (float) $data[ $key ]->value;
348 348
 			}
349 349
 
350
-			$report[] = array(
350
+			$report[ ] = array(
351 351
 				// Flot requires milliseconds so multiply with 1000.
352 352
 				$date->getTimestamp() * 1000,
353 353
 				$value,
Please login to merge, or discard this patch.
classes/Admin/GatewayPostType.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 	public function __construct( AdminModule $admin ) {
37 37
 		$this->admin = $admin;
38 38
 
39
-		add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'edit_columns' ) );
39
+		add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'edit_columns' ) );
40 40
 
41
-		add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
41
+		add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
42 42
 
43 43
 		add_action( 'post_edit_form_tag', array( $this, 'post_edit_form_tag' ) );
44 44
 
45 45
 		add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
46 46
 
47
-		add_action( 'save_post_' . self::POST_TYPE, array( $this, 'save_post' ) );
47
+		add_action( 'save_post_'.self::POST_TYPE, array( $this, 'save_post' ) );
48 48
 
49 49
 		add_action( 'display_post_states', array( $this, 'display_post_states' ), 10, 2 );
50 50
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 							$name = __( 'Dashboard', 'pronamic_ideal' );
143 143
 						}
144 144
 
145
-						$content[] = sprintf(
145
+						$content[ ] = sprintf(
146 146
 							'<a href="%s" target="_blank">%s</a>',
147 147
 							esc_attr( $url ),
148 148
 							esc_html( ucfirst( $name ) )
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 		}
169 169
 
170 170
 		if ( intval( get_option( 'pronamic_pay_config_id' ) ) === $post->ID ) {
171
-			$post_states['pronamic_pay_config_default'] = __( 'Default', 'pronamic_ideal' );
171
+			$post_states[ 'pronamic_pay_config_default' ] = __( 'Default', 'pronamic_ideal' );
172 172
 		}
173 173
 
174 174
 		return $post_states;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	public function meta_box_config( $post ) {
230 230
 		wp_nonce_field( 'pronamic_pay_save_gateway', 'pronamic_pay_nonce' );
231 231
 
232
-		include Plugin::$dirname . '/admin/meta-box-gateway-config.php';
232
+		include Plugin::$dirname.'/admin/meta-box-gateway-config.php';
233 233
 	}
234 234
 
235 235
 	/**
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 	 * @param WP_Post $post The object for the current post/page.
239 239
 	 */
240 240
 	public function meta_box_test( $post ) {
241
-		include Plugin::$dirname . '/admin/meta-box-gateway-test.php';
241
+		include Plugin::$dirname.'/admin/meta-box-gateway-test.php';
242 242
 	}
243 243
 
244 244
 	/**
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	 */
249 249
 	public function save_post( $post_id ) {
250 250
 		// Nonce.
251
-		if ( ! filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) {
251
+		if ( !filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) {
252 252
 			return $post_id;
253 253
 		}
254 254
 
@@ -268,9 +268,9 @@  discard block
 block discarded – undo
268 268
 		);
269 269
 
270 270
 		foreach ( $fields as $field ) {
271
-			if ( isset( $field['meta_key'], $field['filter'] ) ) {
272
-				$name   = $field['meta_key'];
273
-				$filter = $field['filter'];
271
+			if ( isset( $field[ 'meta_key' ], $field[ 'filter' ] ) ) {
272
+				$name   = $field[ 'meta_key' ];
273
+				$filter = $field[ 'filter' ];
274 274
 
275 275
 				$definition[ $name ] = $filter;
276 276
 			}
@@ -278,28 +278,28 @@  discard block
 block discarded – undo
278 278
 
279 279
 		$data = filter_input_array( INPUT_POST, $definition );
280 280
 
281
-		if ( ! empty( $data['_pronamic_gateway_id'] ) ) {
281
+		if ( !empty( $data[ '_pronamic_gateway_id' ] ) ) {
282 282
 			$integrations = $this->admin->plugin->gateway_integrations;
283 283
 
284
-			if ( isset( $integrations[ $data['_pronamic_gateway_id'] ] ) ) {
285
-				$integration = $integrations[ $data['_pronamic_gateway_id'] ];
284
+			if ( isset( $integrations[ $data[ '_pronamic_gateway_id' ] ] ) ) {
285
+				$integration = $integrations[ $data[ '_pronamic_gateway_id' ] ];
286 286
 			}
287 287
 
288 288
 			if ( $integration ) {
289 289
 				$settings = $integration->get_settings();
290 290
 
291 291
 				foreach ( $fields as $field ) {
292
-					if ( isset( $field['default'], $field['meta_key'], $data[ $field['meta_key'] ] ) ) {
292
+					if ( isset( $field[ 'default' ], $field[ 'meta_key' ], $data[ $field[ 'meta_key' ] ] ) ) {
293 293
 						// Remove default value if not applicable to the selected gateway.
294
-						if ( isset( $field['methods'] ) ) {
295
-							$clean_default = array_intersect( $settings, $field['methods'] );
294
+						if ( isset( $field[ 'methods' ] ) ) {
295
+							$clean_default = array_intersect( $settings, $field[ 'methods' ] );
296 296
 
297 297
 							if ( empty( $clean_default ) ) {
298
-								$meta_value = get_post_meta( $post_id, $field['meta_key'], true );
298
+								$meta_value = get_post_meta( $post_id, $field[ 'meta_key' ], true );
299 299
 
300 300
 								// Only remove value if not saved before.
301 301
 								if ( empty( $meta_value ) ) {
302
-									$data[ $field['meta_key'] ] = null;
302
+									$data[ $field[ 'meta_key' ] ] = null;
303 303
 
304 304
 									continue;
305 305
 								}
@@ -307,13 +307,13 @@  discard block
 block discarded – undo
307 307
 						}
308 308
 
309 309
 						// Set the default value if empty.
310
-						if ( empty( $data[ $field['meta_key'] ] ) ) {
311
-							$default = $field['default'];
310
+						if ( empty( $data[ $field[ 'meta_key' ] ] ) ) {
311
+							$default = $field[ 'default' ];
312 312
 
313
-							if ( is_array( $default ) && 2 === count( $default ) && Util::class_method_exists( $default[0], $default[1] ) ) {
314
-								$data[ $field['meta_key'] ] = call_user_func( $default, $field );
313
+							if ( is_array( $default ) && 2 === count( $default ) && Util::class_method_exists( $default[ 0 ], $default[ 1 ] ) ) {
314
+								$data[ $field[ 'meta_key' ] ] = call_user_func( $default, $field );
315 315
 							} else {
316
-								$data[ $field['meta_key'] ] = $default;
316
+								$data[ $field[ 'meta_key' ] ] = $default;
317 317
 							}
318 318
 						}
319 319
 					}
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 				// Filter data through gateway integration settings.
323 323
 				$settings_classes = $integration->get_settings_class();
324 324
 
325
-				if ( ! is_array( $settings_classes ) ) {
325
+				if ( !is_array( $settings_classes ) ) {
326 326
 					$settings_classes = array( $settings_classes );
327 327
 				}
328 328
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 		pronamic_pay_update_post_meta_data( $post_id, $data );
339 339
 
340 340
 		// Transient.
341
-		delete_transient( 'pronamic_pay_issuers_' . $post_id );
341
+		delete_transient( 'pronamic_pay_issuers_'.$post_id );
342 342
 
343 343
 		\Pronamic\WordPress\Pay\Core\PaymentMethods::update_active_payment_methods();
344 344
 	}
@@ -362,14 +362,14 @@  discard block
 block discarded – undo
362 362
 			0  => '', // Unused. Messages start at index 1.
363 363
 			1  => __( 'Configuration updated.', 'pronamic_ideal' ),
364 364
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352799&filters[translation_id]=37947229
365
-			2  => $messages['post'][2],
365
+			2  => $messages[ 'post' ][ 2 ],
366 366
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352800&filters[translation_id]=37947870
367
-			3  => $messages['post'][3],
367
+			3  => $messages[ 'post' ][ 3 ],
368 368
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352798&filters[translation_id]=37947230
369 369
 			4  => __( 'Configuration updated.', 'pronamic_ideal' ),
370 370
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352801&filters[translation_id]=37947231
371 371
 			// translators: %s: date and time of the revision.
372
-			5  => isset( $_GET['revision'] ) ? sprintf( __( 'Configuration restored to revision from %s.', 'pronamic_ideal' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, // WPCS: CSRF ok.
372
+			5  => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'Configuration restored to revision from %s.', 'pronamic_ideal' ), wp_post_revision_title( (int) $_GET[ 'revision' ], false ) ) : false, // WPCS: CSRF ok.
373 373
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352802&filters[translation_id]=37949178
374 374
 			6  => __( 'Configuration published.', 'pronamic_ideal' ),
375 375
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352803&filters[translation_id]=37947232
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352804&filters[translation_id]=37949303
378 378
 			8  => __( 'Configuration submitted.', 'pronamic_ideal' ),
379 379
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352805&filters[translation_id]=37949302
380
-			9  => sprintf( __( 'Configuration scheduled for: %s.', 'pronamic_ideal' ), '<strong>' . $scheduled_date . '</strong>' ),
380
+			9  => sprintf( __( 'Configuration scheduled for: %s.', 'pronamic_ideal' ), '<strong>'.$scheduled_date.'</strong>' ),
381 381
 			// @https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352806&filters[translation_id]=37949301
382 382
 			10 => __( 'Configuration draft updated.', 'pronamic_ideal' ),
383 383
 		);
Please login to merge, or discard this patch.