Passed
Push — develop ( 394b8e...1f7b8a )
by Reüel
05:37
created
classes/Plugin.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 	 * @return array
196 196
 	 */
197 197
 	public function exclude_comment_notes( $clauses, $query ) {
198
-		$type = $query->query_vars['type'];
198
+		$type = $query->query_vars[ 'type' ];
199 199
 
200 200
 		// Ignore payment notes comments if it's not specifically requested.
201 201
 		if ( 'payment_note' !== $type ) {
202
-			$clauses['where'] .= " AND comment_type != 'payment_note'";
202
+			$clauses[ 'where' ] .= " AND comment_type != 'payment_note'";
203 203
 		}
204 204
 
205 205
 		return $clauses;
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 				break;
244 244
 		}
245 245
 
246
-		if ( ! empty( $page_id ) ) {
246
+		if ( !empty( $page_id ) ) {
247 247
 			$page_url = get_permalink( $page_id );
248 248
 
249 249
 			if ( false !== $page_url ) {
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	 * Handle returns.
307 307
 	 */
308 308
 	public function handle_returns() {
309
-		if ( ! filter_has_var( INPUT_GET, 'payment' ) ) {
309
+		if ( !filter_has_var( INPUT_GET, 'payment' ) ) {
310 310
 			return;
311 311
 		}
312 312
 
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 			$valid_key = ( $key === $payment->key );
326 326
 		}
327 327
 
328
-		if ( ! $valid_key ) {
328
+		if ( !$valid_key ) {
329 329
 			wp_redirect( home_url() );
330 330
 
331 331
 			exit;
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 	 * Maybe redirect.
354 354
 	 */
355 355
 	public function maybe_redirect() {
356
-		if ( ! filter_has_var( INPUT_GET, 'payment_redirect' ) ) {
356
+		if ( !filter_has_var( INPUT_GET, 'payment_redirect' ) ) {
357 357
 			return;
358 358
 		}
359 359
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 		// HTML Answer.
365 365
 		$html_answer = $payment->get_meta( 'ogone_directlink_html_answer' );
366 366
 
367
-		if ( ! empty( $html_answer ) ) {
367
+		if ( !empty( $html_answer ) ) {
368 368
 			echo $html_answer; // WPCS: XSS ok.
369 369
 
370 370
 			exit;
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 
373 373
 		$redirect_message = $payment->get_meta( 'payment_redirect_message' );
374 374
 
375
-		if ( ! empty( $redirect_message ) ) {
375
+		if ( !empty( $redirect_message ) ) {
376 376
 			$key = filter_input( INPUT_GET, 'key', FILTER_SANITIZE_STRING );
377 377
 
378 378
 			if ( $key !== $payment->key ) {
@@ -383,29 +383,29 @@  discard block
 block discarded – undo
383 383
 
384 384
 			// @see https://github.com/woothemes/woocommerce/blob/2.3.11/includes/class-wc-cache-helper.php
385 385
 			// @see https://www.w3-edge.com/products/w3-total-cache/
386
-			if ( ! defined( 'DONOTCACHEPAGE' ) ) {
386
+			if ( !defined( 'DONOTCACHEPAGE' ) ) {
387 387
 				define( 'DONOTCACHEPAGE', true );
388 388
 			}
389 389
 
390
-			if ( ! defined( 'DONOTCACHEDB' ) ) {
390
+			if ( !defined( 'DONOTCACHEDB' ) ) {
391 391
 				define( 'DONOTCACHEDB', true );
392 392
 			}
393 393
 
394
-			if ( ! defined( 'DONOTMINIFY' ) ) {
394
+			if ( !defined( 'DONOTMINIFY' ) ) {
395 395
 				define( 'DONOTMINIFY', true );
396 396
 			}
397 397
 
398
-			if ( ! defined( 'DONOTCDN' ) ) {
398
+			if ( !defined( 'DONOTCDN' ) ) {
399 399
 				define( 'DONOTCDN', true );
400 400
 			}
401 401
 
402
-			if ( ! defined( 'DONOTCACHEOBJECT' ) ) {
402
+			if ( !defined( 'DONOTCACHEOBJECT' ) ) {
403 403
 				define( 'DONOTCACHEOBJECT', true );
404 404
 			}
405 405
 
406 406
 			nocache_headers();
407 407
 
408
-			include Plugin::$dirname . '/views/redirect-message.php';
408
+			include Plugin::$dirname.'/views/redirect-message.php';
409 409
 
410 410
 			exit;
411 411
 		}
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 			}
425 425
 		}
426 426
 
427
-		if ( ! empty( $payment->action_url ) ) {
427
+		if ( !empty( $payment->action_url ) ) {
428 428
 			wp_redirect( $payment->action_url );
429 429
 
430 430
 			exit;
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 	 */
454 454
 	public function plugins_loaded() {
455 455
 		// Load plugin text domain.
456
-		$rel_path = dirname( plugin_basename( self::$file ) ) . '/languages/';
456
+		$rel_path = dirname( plugin_basename( self::$file ) ).'/languages/';
457 457
 
458 458
 		load_plugin_textdomain( 'pronamic_ideal', false, $rel_path );
459 459
 
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 		);
548 548
 
549 549
 		if ( $payment_method ) {
550
-			$args['post__in'] = PaymentMethods::get_config_ids( $payment_method );
550
+			$args[ 'post__in' ] = PaymentMethods::get_config_ids( $payment_method );
551 551
 		}
552 552
 
553 553
 		$query = new WP_Query( $args );
@@ -588,12 +588,12 @@  discard block
 block discarded – undo
588 588
 	 * @param array $errors An array with errors to render.
589 589
 	 */
590 590
 	public static function render_errors( $errors = array() ) {
591
-		if ( ! is_array( $errors ) ) {
591
+		if ( !is_array( $errors ) ) {
592 592
 			$errors = array( $errors );
593 593
 		}
594 594
 
595 595
 		foreach ( $errors as $error ) {
596
-			include Plugin::$dirname . '/views/error.php';
596
+			include Plugin::$dirname.'/views/error.php';
597 597
 		}
598 598
 	}
599 599
 
@@ -758,10 +758,10 @@  discard block
 block discarded – undo
758 758
 		$payment->set_credit_card( $data->get_credit_card() );
759 759
 
760 760
 		// User Agent (@see https://github.com/WordPress/WordPress/blob/4.9.4/wp-includes/comment.php#L1962-L1965).
761
-		$payment->user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : null;
761
+		$payment->user_agent = isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) ? $_SERVER[ 'HTTP_USER_AGENT' ] : null;
762 762
 
763 763
 		// IP (@see https://github.com/WordPress/WordPress/blob/4.9.4/wp-includes/comment.php#L1957-L1960).
764
-		$payment->user_ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : null;
764
+		$payment->user_ip = isset( $_SERVER[ 'REMOTE_ADDR' ] ) ? $_SERVER[ 'REMOTE_ADDR' ] : null;
765 765
 
766 766
 		return self::start_payment( $payment, $gateway );
767 767
 	}
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 			$subscription = $payment->get_subscription();
792 792
 
793 793
 			if ( $subscription ) {
794
-				if ( ! $payment->get_recurring() ) {
794
+				if ( !$payment->get_recurring() ) {
795 795
 					// First payment.
796 796
 					// Cancel subscription to prevent unwanted recurring payments in the future,
797 797
 					// when a valid customer ID might be set for the user.
Please login to merge, or discard this patch.
classes/Admin/SubscriptionPostType.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	public function __construct() {
32 32
 		add_filter( 'request', array( $this, 'request' ) );
33 33
 
34
-		add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'columns' ) );
35
-		add_filter( 'manage_edit-' . self::POST_TYPE . '_sortable_columns', array( $this, 'sortable_columns' ) );
34
+		add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'columns' ) );
35
+		add_filter( 'manage_edit-'.self::POST_TYPE.'_sortable_columns', array( $this, 'sortable_columns' ) );
36 36
 
37
-		add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
37
+		add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
38 38
 
39 39
 		add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
40 40
 
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
 		$screen = get_current_screen();
57 57
 
58 58
 		if ( self::POST_TYPE === $screen->post_type ) {
59
-			if ( ! isset( $vars['post_status'] ) ) {
60
-				$vars['post_status'] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_subscription_states() );
59
+			if ( !isset( $vars[ 'post_status' ] ) ) {
60
+				$vars[ 'post_status' ] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_subscription_states() );
61 61
 
62
-				$vars['post_status'][] = 'publish';
62
+				$vars[ 'post_status' ][ ] = 'publish';
63 63
 			}
64 64
 		}
65 65
 
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 	 * @return array
98 98
 	 */
99 99
 	public function sortable_columns( $sortable_columns ) {
100
-		$sortable_columns['pronamic_subscription_title'] = 'ID';
101
-		$sortable_columns['pronamic_subscription_date']  = 'date';
100
+		$sortable_columns[ 'pronamic_subscription_title' ] = 'ID';
101
+		$sortable_columns[ 'pronamic_subscription_date' ]  = 'date';
102 102
 
103 103
 		return $sortable_columns;
104 104
 	}
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 				$source_id          = $subscription->get_source_id();
142 142
 				$source_description = $subscription->get_source_description();
143 143
 
144
-				$source_id_text = '#' . $source_id;
144
+				$source_id_text = '#'.$source_id;
145 145
 
146 146
 				$source_link = $subscription->get_source_link();
147 147
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 					$config_id = get_post_meta( $payment->get_id(), '_pronamic_payment_config_id', true );
182 182
 				}
183 183
 
184
-				if ( isset( $config_id ) && ! empty( $config_id ) ) {
184
+				if ( isset( $config_id ) && !empty( $config_id ) ) {
185 185
 					echo get_the_title( $config_id );
186 186
 				} else {
187 187
 					echo '—';
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 	 * @param WP_Post $post The object for the current post/page.
306 306
 	 */
307 307
 	public function meta_box_info( $post ) {
308
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-subscription-info.php';
308
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-subscription-info.php';
309 309
 	}
310 310
 
311 311
 	/**
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 			)
322 322
 		);
323 323
 
324
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-notes.php';
324
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-notes.php';
325 325
 	}
326 326
 
327 327
 	/**
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	 * @param WP_Post $post The object for the current post/page.
331 331
 	 */
332 332
 	public function meta_box_payments( $post ) {
333
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-subscription-payments.php';
333
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-subscription-payments.php';
334 334
 	}
335 335
 
336 336
 	/**
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 	public function meta_box_update( $post ) {
342 342
 		wp_nonce_field( 'pronamic_subscription_update', 'pronamic_subscription_update_nonce' );
343 343
 
344
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-subscription-update.php';
344
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-subscription-update.php';
345 345
 	}
346 346
 
347 347
 	/**
@@ -390,11 +390,11 @@  discard block
 block discarded – undo
390 390
 	 * @param \WP_Post $post       WordPress post.
391 391
 	 */
392 392
 	public function transition_post_status( $new_status, $old_status, $post ) {
393
-		if ( ! filter_has_var( INPUT_POST, 'pronamic_subscription_update_nonce' ) ) {
393
+		if ( !filter_has_var( INPUT_POST, 'pronamic_subscription_update_nonce' ) ) {
394 394
 			return;
395 395
 		}
396 396
 
397
-		if ( ! check_admin_referer( 'pronamic_subscription_update', 'pronamic_subscription_update_nonce' ) ) {
397
+		if ( !check_admin_referer( 'pronamic_subscription_update', 'pronamic_subscription_update_nonce' ) ) {
398 398
 			return;
399 399
 		}
400 400
 
Please login to merge, or discard this patch.