Passed
Push — develop ( 241920...38771c )
by Reüel
04:19
created
classes/Forms/FormProcessor.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,20 +39,20 @@  discard block
 block discarded – undo
39 39
 		$pronamic_pay_errors = array();
40 40
 
41 41
 		// Nonce.
42
-		if ( ! filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) {
42
+		if ( !filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) {
43 43
 			return;
44 44
 		}
45 45
 
46 46
 		$nonce = filter_input( INPUT_POST, 'pronamic_pay_nonce', FILTER_SANITIZE_STRING );
47 47
 
48
-		if ( ! wp_verify_nonce( $nonce, 'pronamic_pay' ) ) {
48
+		if ( !wp_verify_nonce( $nonce, 'pronamic_pay' ) ) {
49 49
 			return;
50 50
 		}
51 51
 
52 52
 		// Validate.
53 53
 		$valid = $this->validate();
54 54
 
55
-		if ( ! $valid ) {
55
+		if ( !$valid ) {
56 56
 			return;
57 57
 		}
58 58
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 		$gateway = \Pronamic\WordPress\Pay\Plugin::get_gateway( $config_id );
65 65
 
66
-		if ( ! $gateway ) {
66
+		if ( !$gateway ) {
67 67
 			return;
68 68
 		}
69 69
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
 		$user = get_user_by( 'email', $email );
90 90
 
91
-		if ( ! $user ) {
91
+		if ( !$user ) {
92 92
 			// Make a random string for password.
93 93
 			$password = wp_generate_password( 10 );
94 94
 
@@ -132,14 +132,14 @@  discard block
 block discarded – undo
132 132
 		$first_name = filter_input( INPUT_POST, 'pronamic_pay_first_name', FILTER_SANITIZE_STRING );
133 133
 
134 134
 		if ( empty( $first_name ) ) {
135
-			$pronamic_pay_errors['first_name'] = __( 'Please enter your first name', 'pronamic_ideal' );
135
+			$pronamic_pay_errors[ 'first_name' ] = __( 'Please enter your first name', 'pronamic_ideal' );
136 136
 		}
137 137
 
138 138
 		// E-mail.
139 139
 		$email = filter_input( INPUT_POST, 'pronamic_pay_email', FILTER_VALIDATE_EMAIL );
140 140
 
141 141
 		if ( empty( $email ) ) {
142
-			$pronamic_pay_errors['email'] = __( 'Please enter a valid email address', 'pronamic_ideal' );
142
+			$pronamic_pay_errors[ 'email' ] = __( 'Please enter a valid email address', 'pronamic_ideal' );
143 143
 		}
144 144
 
145 145
 		return empty( $pronamic_pay_errors );
Please login to merge, or discard this patch.
classes/Forms/FormScripts.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
 		wp_register_style(
40 40
 			'pronamic-pay-forms',
41
-			plugins_url( 'css/forms' . $min . '.css', \Pronamic\WordPress\Pay\Plugin::$file ),
41
+			plugins_url( 'css/forms'.$min.'.css', \Pronamic\WordPress\Pay\Plugin::$file ),
42 42
 			array(),
43 43
 			$this->plugin->get_version()
44 44
 		);
Please login to merge, or discard this patch.
classes/Forms/PaymentFormData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
 		$first_name = filter_input( INPUT_POST, 'pronamic_pay_first_name', FILTER_SANITIZE_STRING );
132 132
 		$last_name  = filter_input( INPUT_POST, 'pronamic_pay_last_name', FILTER_SANITIZE_STRING );
133 133
 
134
-		return $first_name . ' ' . $last_name;
134
+		return $first_name.' '.$last_name;
135 135
 	}
136 136
 
137 137
 	/**
Please login to merge, or discard this patch.
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
 
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 			'test' => 'https://abnamro-test.ideal-payment.de/',
514 514
 			'live' => 'https://abnamro.ideal-payment.de/',
515 515
 		);
516
-		$integration->provider      = 'abnamro';
516
+		$integration->provider = 'abnamro';
517 517
 
518 518
 		$integrations[ $integration->get_id() ] = $integration;
519 519
 
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 			'test' => 'https://myideal.test.db.com/',
541 541
 			'live' => 'https://myideal.db.com/',
542 542
 		);
543
-		$integration->provider      = 'deutschebank';
543
+		$integration->provider = 'deutschebank';
544 544
 
545 545
 		$integrations[ $integration->get_id() ] = $integration;
546 546
 
@@ -949,7 +949,7 @@  discard block
 block discarded – undo
949 949
 					break;
950 950
 			}
951 951
 
952
-			$args['meta_query'] = array(
952
+			$args[ 'meta_query' ] = array(
953 953
 				array(
954 954
 					'key'     => '_pronamic_gateway_id',
955 955
 					'value'   => $gateways,
@@ -996,12 +996,12 @@  discard block
 block discarded – undo
996 996
 	 * @param array $errors An array with errors to render.
997 997
 	 */
998 998
 	public static function render_errors( $errors = array() ) {
999
-		if ( ! is_array( $errors ) ) {
999
+		if ( !is_array( $errors ) ) {
1000 1000
 			$errors = array( $errors );
1001 1001
 		}
1002 1002
 
1003 1003
 		foreach ( $errors as $error ) {
1004
-			include Plugin::$dirname . '/views/error.php';
1004
+			include Plugin::$dirname.'/views/error.php';
1005 1005
 		}
1006 1006
 	}
1007 1007
 
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
 			$subscription = $payment->get_subscription();
1190 1190
 
1191 1191
 			if ( $subscription ) {
1192
-				if ( ! $payment->get_recurring() ) {
1192
+				if ( !$payment->get_recurring() ) {
1193 1193
 					// First payment.
1194 1194
 					// Cancel subscription to prevent unwanted recurring payments in the future,
1195 1195
 					// when a valid customer ID might be set for the user.
Please login to merge, or discard this patch.
classes/Admin/Install.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
 		// Payments.
155 155
 		$payment_capabilities = PaymentPostType::get_capabilities();
156 156
 
157
-		unset( $payment_capabilities['publish_posts'] );
158
-		unset( $payment_capabilities['create_posts'] );
157
+		unset( $payment_capabilities[ 'publish_posts' ] );
158
+		unset( $payment_capabilities[ 'create_posts' ] );
159 159
 
160 160
 		foreach ( $payment_capabilities as $capability ) {
161 161
 			$roles->add_cap( 'administrator', $capability );
@@ -179,11 +179,11 @@  discard block
 block discarded – undo
179 179
 
180 180
 		if ( $current_db_version ) {
181 181
 			foreach ( $this->db_updates as $version ) {
182
-				if ( ! version_compare( $current_db_version, $version, '<' ) ) {
182
+				if ( !version_compare( $current_db_version, $version, '<' ) ) {
183 183
 					continue;
184 184
 				}
185 185
 
186
-				$file = plugin_dir_path( Plugin::$file ) . 'includes/updates/update-' . $version . '.php';
186
+				$file = plugin_dir_path( Plugin::$file ).'includes/updates/update-'.$version.'.php';
187 187
 
188 188
 				if ( is_readable( $file ) ) {
189 189
 					include $file;
Please login to merge, or discard this patch.
classes/Admin/PaymentPostType.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
 	public function __construct() {
39 39
 		add_filter( 'request', array( $this, 'request' ) );
40 40
 
41
-		add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'columns' ) );
42
-		add_filter( 'manage_edit-' . self::POST_TYPE . '_sortable_columns', array( $this, 'sortable_columns' ) );
41
+		add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'columns' ) );
42
+		add_filter( 'manage_edit-'.self::POST_TYPE.'_sortable_columns', array( $this, 'sortable_columns' ) );
43 43
 
44
-		add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
44
+		add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
45 45
 
46 46
 		add_action( 'load-post.php', array( $this, 'maybe_check_status' ) );
47 47
 
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 		$screen = get_current_screen();
77 77
 
78 78
 		if ( self::POST_TYPE === $screen->post_type ) {
79
-			if ( ! isset( $vars['post_status'] ) ) {
80
-				$vars['post_status'] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_payment_states() );
79
+			if ( !isset( $vars[ 'post_status' ] ) ) {
80
+				$vars[ 'post_status' ] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_payment_states() );
81 81
 
82
-				$vars['post_status'][] = 'publish';
82
+				$vars[ 'post_status' ][ ] = 'publish';
83 83
 			}
84 84
 		}
85 85
 
@@ -91,25 +91,25 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function maybe_check_status() {
93 93
 		// Current user.
94
-		if ( ! current_user_can( 'edit_payments' ) ) {
94
+		if ( !current_user_can( 'edit_payments' ) ) {
95 95
 			return;
96 96
 		}
97 97
 
98 98
 		// Screen.
99 99
 		$screen = get_current_screen();
100 100
 
101
-		if ( ! ( 'post' === $screen->base && 'pronamic_payment' === $screen->post_type ) ) {
101
+		if ( !( 'post' === $screen->base && 'pronamic_payment' === $screen->post_type ) ) {
102 102
 			return;
103 103
 		}
104 104
 
105 105
 		$post_id = filter_input( INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT );
106 106
 
107
-		if ( filter_has_var( INPUT_GET, 'pronamic_pay_check_status' ) && check_admin_referer( 'pronamic_payment_check_status_' . $post_id ) ) {
107
+		if ( filter_has_var( INPUT_GET, 'pronamic_pay_check_status' ) && check_admin_referer( 'pronamic_payment_check_status_'.$post_id ) ) {
108 108
 			$payment = get_pronamic_payment( $post_id );
109 109
 
110 110
 			\Pronamic\WordPress\Pay\Plugin::update_payment( $payment, false );
111 111
 
112
-			$this->admin_notices[] = array(
112
+			$this->admin_notices[ ] = array(
113 113
 				'type'    => 'info',
114 114
 				'message' => __( 'Payment status updated.', 'pronamic_ideal' ),
115 115
 			);
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 		foreach ( $this->admin_notices as $notice ) {
124 124
 			printf(
125 125
 				'<div class="notice notice-%1$s"><p>%2$s</p></div>',
126
-				esc_attr( $notice['type'] ),
127
-				esc_html( $notice['message'] )
126
+				esc_attr( $notice[ 'type' ] ),
127
+				esc_html( $notice[ 'message' ] )
128 128
 			);
129 129
 		}
130 130
 	}
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
 	 * @return array
180 180
 	 */
181 181
 	public function default_hidden_columns( $hidden ) {
182
-		$hidden[] = 'pronamic_payment_gateway';
183
-		$hidden[] = 'pronamic_payment_description';
182
+		$hidden[ ] = 'pronamic_payment_gateway';
183
+		$hidden[ ] = 'pronamic_payment_description';
184 184
 
185 185
 		return $hidden;
186 186
 	}
@@ -192,9 +192,9 @@  discard block
 block discarded – undo
192 192
 	 * @return array
193 193
 	 */
194 194
 	public function sortable_columns( $sortable_columns ) {
195
-		$sortable_columns['pronamic_payment_title']  = 'ID';
196
-		$sortable_columns['pronamic_payment_amount'] = 'pronamic_payment_amount';
197
-		$sortable_columns['pronamic_payment_date']   = 'date';
195
+		$sortable_columns[ 'pronamic_payment_title' ]  = 'ID';
196
+		$sortable_columns[ 'pronamic_payment_amount' ] = 'pronamic_payment_amount';
197
+		$sortable_columns[ 'pronamic_payment_date' ]   = 'date';
198 198
 
199 199
 		return $sortable_columns;
200 200
 	}
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
 					$recurring = get_post_meta( $post_id, '_pronamic_payment_recurring', true );
243 243
 
244
-					if ( ! $recurring ) {
244
+					if ( !$recurring ) {
245 245
 						$label = __( 'First of recurring payment', 'pronamic_ideal' );
246 246
 						$class = ' pronamic-pay-icon-recurring-first';
247 247
 					}
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 				$source_id          = $payment->get_source_id();
261 261
 				$source_description = $payment->get_source_description();
262 262
 
263
-				$source_id_text = '#' . $source_id;
263
+				$source_id_text = '#'.$source_id;
264 264
 
265 265
 				$source_link = $payment->get_source_link();
266 266
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 			case 'pronamic_payment_gateway':
297 297
 				$config_id = get_post_meta( $post_id, '_pronamic_payment_config_id', true );
298 298
 
299
-				if ( ! empty( $config_id ) ) {
299
+				if ( !empty( $config_id ) ) {
300 300
 					echo get_the_title( $config_id );
301 301
 				} else {
302 302
 					echo '—';
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 	 * @param WP_Post $post The object for the current post/page.
410 410
 	 */
411 411
 	public function meta_box_info( $post ) {
412
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-payment-info.php';
412
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-payment-info.php';
413 413
 	}
414 414
 
415 415
 	/**
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 	 * @param WP_Post $post The object for the current post/page.
419 419
 	 */
420 420
 	public function meta_box_log( $post ) {
421
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-payment-log.php';
421
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-payment-log.php';
422 422
 	}
423 423
 
424 424
 	/**
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 	 * @param WP_Post $post The object for the current post/page.
428 428
 	 */
429 429
 	public function meta_box_subscription( $post ) {
430
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-payment-subscription.php';
430
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-payment-subscription.php';
431 431
 	}
432 432
 
433 433
 	/**
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 	public function meta_box_update( $post ) {
439 439
 		wp_nonce_field( 'pronamic_payment_update', 'pronamic_payment_update_nonce' );
440 440
 
441
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-payment-update.php';
441
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-payment-update.php';
442 442
 	}
443 443
 
444 444
 	/**
@@ -507,8 +507,8 @@  discard block
 block discarded – undo
507 507
 
508 508
 			$payment = get_pronamic_payment( $post->ID );
509 509
 
510
-			do_action( 'pronamic_payment_status_update_' . $payment->source . '_' . strtolower( $old_status_meta ) . '_to_' . strtolower( $new_status_meta ), $payment, $can_redirect );
511
-			do_action( 'pronamic_payment_status_update_' . $payment->source, $payment, $can_redirect );
510
+			do_action( 'pronamic_payment_status_update_'.$payment->source.'_'.strtolower( $old_status_meta ).'_to_'.strtolower( $new_status_meta ), $payment, $can_redirect );
511
+			do_action( 'pronamic_payment_status_update_'.$payment->source, $payment, $can_redirect );
512 512
 			do_action( 'pronamic_payment_status_update', $payment, $can_redirect );
513 513
 		}
514 514
 	}
@@ -532,14 +532,14 @@  discard block
 block discarded – undo
532 532
 			0  => '', // Unused. Messages start at index 1.
533 533
 			1  => __( 'Payment updated.', 'pronamic_ideal' ),
534 534
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352799&filters[translation_id]=37947229.
535
-			2  => $messages['post'][2],
535
+			2  => $messages[ 'post' ][ 2 ],
536 536
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352800&filters[translation_id]=37947870.
537
-			3  => $messages['post'][3],
537
+			3  => $messages[ 'post' ][ 3 ],
538 538
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352798&filters[translation_id]=37947230.
539 539
 			4  => __( 'Payment updated.', 'pronamic_ideal' ),
540 540
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352801&filters[translation_id]=37947231.
541 541
 			// translators: %s: date and time of the revision
542
-			5  => isset( $_GET['revision'] ) ? sprintf( __( 'Payment restored to revision from %s.', 'pronamic_ideal' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, // WPCS: CSRF ok.
542
+			5  => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'Payment restored to revision from %s.', 'pronamic_ideal' ), wp_post_revision_title( (int) $_GET[ 'revision' ], false ) ) : false, // WPCS: CSRF ok.
543 543
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352802&filters[translation_id]=37949178.
544 544
 			6  => __( 'Payment published.', 'pronamic_ideal' ),
545 545
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352803&filters[translation_id]=37947232.
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352804&filters[translation_id]=37949303.
548 548
 			8  => __( 'Payment submitted.', 'pronamic_ideal' ),
549 549
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352805&filters[translation_id]=37949302.
550
-			9  => sprintf( __( 'Payment scheduled for: %s.', 'pronamic_ideal' ), '<strong>' . $scheduled_date . '</strong>' ),
550
+			9  => sprintf( __( 'Payment scheduled for: %s.', 'pronamic_ideal' ), '<strong>'.$scheduled_date.'</strong>' ),
551 551
 			// @https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352806&filters[translation_id]=37949301.
552 552
 			10 => __( 'Payment draft updated.', 'pronamic_ideal' ),
553 553
 		);
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
@@ -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.