Passed
Push — develop ( 36711b...a8b6aa )
by Reüel
05:22
created
admin/meta-box-gateway-test.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		// Payment method input HTML.
36 36
 		$html = $gateway->get_input_html();
37 37
 
38
-		if ( ! empty( $html ) ) {
38
+		if ( !empty( $html ) ) {
39 39
 			$inputs[ $payment_method ] = array(
40 40
 				'label' => $method_name,
41 41
 				'html'  => $html,
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
 	}
45 45
 
46 46
 	if ( $gateway->has_error() ) {
47
-		$pronamic_ideal_errors[] = $gateway->get_error();
47
+		$pronamic_ideal_errors[ ] = $gateway->get_error();
48 48
 	}
49 49
 
50
-	include Plugin::$dirname . '/views/errors.php';
50
+	include Plugin::$dirname.'/views/errors.php';
51 51
 
52 52
 	?>
53 53
 	<table class="form-table">
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 
80 80
 			<tr class="pronamic-pay-cloack pronamic-pay-test-payment-method <?php echo esc_attr( $method ); ?>">
81 81
 				<th scope="row">
82
-					<?php echo esc_html( $input['label'] ); ?>
82
+					<?php echo esc_html( $input[ 'label' ] ); ?>
83 83
 				</th>
84 84
 				<td>
85 85
 					<?php
86 86
 
87
-					echo $input['html']; // WPCS: XSS ok.
87
+					echo $input[ 'html' ]; // WPCS: XSS ok.
88 88
 
89 89
 					?>
90 90
 				</td>
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	<?php
297 297
 
298 298
 	if ( $is_ideal || $gateway instanceof \Pronamic\WordPress\Pay\Gateways\OmniKassa2\Gateway ) {
299
-		include Plugin::$dirname . '/views/ideal-test-cases.php';
299
+		include Plugin::$dirname.'/views/ideal-test-cases.php';
300 300
 	}
301 301
 } else {
302 302
 	printf(
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
 
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 					break;
681 681
 			}
682 682
 
683
-			$args['meta_query'] = array(
683
+			$args[ 'meta_query' ] = array(
684 684
 				array(
685 685
 					'key'     => '_pronamic_gateway_id',
686 686
 					'value'   => $gateways,
@@ -727,12 +727,12 @@  discard block
 block discarded – undo
727 727
 	 * @param array $errors An array with errors to render.
728 728
 	 */
729 729
 	public static function render_errors( $errors = array() ) {
730
-		if ( ! is_array( $errors ) ) {
730
+		if ( !is_array( $errors ) ) {
731 731
 			$errors = array( $errors );
732 732
 		}
733 733
 
734 734
 		foreach ( $errors as $error ) {
735
-			include Plugin::$dirname . '/views/error.php';
735
+			include Plugin::$dirname.'/views/error.php';
736 736
 		}
737 737
 	}
738 738
 
@@ -893,10 +893,10 @@  discard block
 block discarded – undo
893 893
 		$payment->set_credit_card( $data->get_credit_card() );
894 894
 
895 895
 		// User Agent (@see https://github.com/WordPress/WordPress/blob/4.9.4/wp-includes/comment.php#L1962-L1965).
896
-		$payment->user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : null;
896
+		$payment->user_agent = isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) ? $_SERVER[ 'HTTP_USER_AGENT' ] : null;
897 897
 
898 898
 		// IP (@see https://github.com/WordPress/WordPress/blob/4.9.4/wp-includes/comment.php#L1957-L1960).
899
-		$payment->user_ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : null;
899
+		$payment->user_ip = isset( $_SERVER[ 'REMOTE_ADDR' ] ) ? $_SERVER[ 'REMOTE_ADDR' ] : null;
900 900
 
901 901
 		return self::start_payment( $payment, $gateway );
902 902
 	}
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
 			$subscription = $payment->get_subscription();
927 927
 
928 928
 			if ( $subscription ) {
929
-				if ( ! $payment->get_recurring() ) {
929
+				if ( !$payment->get_recurring() ) {
930 930
 					// First payment.
931 931
 					// Cancel subscription to prevent unwanted recurring payments in the future,
932 932
 					// when a valid customer ID might be set for the user.
Please login to merge, or discard this patch.