Passed
Push — develop ( 3adc2f...c1e48d )
by Reüel
04:53
created
classes/Payments/PaymentsDataStoreCPT.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
 		$post_status = $this->get_post_status( $payment->status );
116 116
 
117 117
 		if ( ! empty( $post_status ) ) {
118
-			$data['post_status'] = $post_status;
118
+			$data[ 'post_status' ] = $post_status;
119 119
 		}
120 120
 
121 121
 		wp_update_post( $data );
Please login to merge, or discard this patch.
classes/Admin/GatewaySettings.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		$classes = apply_filters( 'pronamic_pay_gateway_settings', array() );
40 40
 
41 41
 		foreach ( $classes as $class ) {
42
-			$this->settings[] = new $class();
42
+			$this->settings[ ] = new $class();
43 43
 		}
44 44
 	}
45 45
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 			$gateway_id = get_post_meta( $config_id, '_pronamic_gateway_id', true );
66 66
 
67 67
 			// Payment methods.
68
-			$sections['payment_methods'] = array(
68
+			$sections[ 'payment_methods' ] = array(
69 69
 				'title'       => __( 'Payment Methods', 'pronamic_ideal' ),
70 70
 				'methods'     => array(
71 71
 					$gateway_id,
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		);
107 107
 
108 108
 		// Payment methods.
109
-		$fields[] = array(
109
+		$fields[ ] = array(
110 110
 			'section'  => 'payment_methods',
111 111
 			'type'     => 'html',
112 112
 			'callback' => array( $this, 'gateway_payment_methods' ),
Please login to merge, or discard this patch.
classes/Admin/AdminPaymentBulkActions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -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
 	}
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 				$gateways[ $config_id ] = \Pronamic\WordPress\Pay\Plugin::get_gateway( $config_id );
107 107
 
108 108
 				if ( $gateways[ $config_id ] && ! $gateways[ $config_id ]->supports( 'payment_status_request' ) ) {
109
-					$unsupported_gateways[] = $config_id;
109
+					$unsupported_gateways[ ] = $config_id;
110 110
 				}
111 111
 			}
112 112
 
Please login to merge, or discard this patch.
classes/Subscriptions/SubscriptionsDataStoreCPT.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
 		$post_status = $this->get_post_status( $subscription->get_status() );
101 101
 
102 102
 		if ( ! empty( $post_status ) ) {
103
-			$data['post_status'] = $post_status;
103
+			$data[ 'post_status' ] = $post_status;
104 104
 		}
105 105
 
106 106
 		wp_update_post( $data );
Please login to merge, or discard this patch.
src/check-versions.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 
47 47
 foreach ( $tokens as $token ) {
48 48
 	if ( is_array( $token ) ) {
49
-		$type  = $token[0];
50
-		$value = $token[1];
51
-		$line  = $token[2];
49
+		$type  = $token[ 0 ];
50
+		$value = $token[ 1 ];
51
+		$line  = $token[ 2 ];
52 52
 
53 53
 		if ( in_array( $type, array( T_COMMENT, T_DOC_COMMENT ), true ) && false !== strpos( $value, 'Plugin Name' ) ) {
54 54
 			$file_header = $value;
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
 	exit( 1 );
91 91
 }
92 92
 
93
-if ( $default_properties['version'] !== $pkg->version ) {
93
+if ( $default_properties[ 'version' ] !== $pkg->version ) {
94 94
 	printf( '❌  ' );
95
-	printf( 'The "version" property value "%s" in class "%s" does not match.', $default_properties['version'], $plugin_class_reflection->getName() );
95
+	printf( 'The "version" property value "%s" in class "%s" does not match.', $default_properties[ 'version' ], $plugin_class_reflection->getName() );
96 96
 
97 97
 	exit( 1 );
98 98
 }
99 99
 
100 100
 printf( '✅  ' );
101
-printf( 'The "version" property value "%s" in class "%s" matches.', $default_properties['version'], $plugin_class_reflection->getName() );
101
+printf( 'The "version" property value "%s" in class "%s" matches.', $default_properties[ 'version' ], $plugin_class_reflection->getName() );
102 102
 
103 103
 echo PHP_EOL;
Please login to merge, or discard this patch.
classes/Admin/AdminGatewayPostType.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 							$name = __( 'Dashboard', 'pronamic_ideal' );
154 154
 						}
155 155
 
156
-						$content[] = sprintf(
156
+						$content[ ] = sprintf(
157 157
 							'<a href="%s" target="_blank">%s</a>',
158 158
 							esc_attr( $url ),
159 159
 							esc_html( ucfirst( $name ) )
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 		}
180 180
 
181 181
 		if ( intval( get_option( 'pronamic_pay_config_id' ) ) === $post->ID ) {
182
-			$post_states['pronamic_pay_config_default'] = __( 'Default', 'pronamic_ideal' );
182
+			$post_states[ 'pronamic_pay_config_default' ] = __( 'Default', 'pronamic_ideal' );
183 183
 		}
184 184
 
185 185
 		return $post_states;
@@ -273,9 +273,9 @@  discard block
 block discarded – undo
273 273
 		);
274 274
 
275 275
 		foreach ( $fields as $field ) {
276
-			if ( isset( $field['meta_key'], $field['filter'] ) ) {
277
-				$name   = $field['meta_key'];
278
-				$filter = $field['filter'];
276
+			if ( isset( $field[ 'meta_key' ], $field[ 'filter' ] ) ) {
277
+				$name   = $field[ 'meta_key' ];
278
+				$filter = $field[ 'filter' ];
279 279
 
280 280
 				$definition[ $name ] = $filter;
281 281
 			}
@@ -283,28 +283,28 @@  discard block
 block discarded – undo
283 283
 
284 284
 		$data = filter_input_array( INPUT_POST, $definition );
285 285
 
286
-		if ( ! empty( $data['_pronamic_gateway_id'] ) ) {
286
+		if ( ! empty( $data[ '_pronamic_gateway_id' ] ) ) {
287 287
 			$integrations = $this->plugin->gateway_integrations;
288 288
 
289
-			if ( isset( $integrations[ $data['_pronamic_gateway_id'] ] ) ) {
290
-				$integration = $integrations[ $data['_pronamic_gateway_id'] ];
289
+			if ( isset( $integrations[ $data[ '_pronamic_gateway_id' ] ] ) ) {
290
+				$integration = $integrations[ $data[ '_pronamic_gateway_id' ] ];
291 291
 			}
292 292
 
293 293
 			if ( $integration ) {
294 294
 				$settings = $integration->get_settings();
295 295
 
296 296
 				foreach ( $fields as $field ) {
297
-					if ( isset( $field['default'], $field['meta_key'], $data[ $field['meta_key'] ] ) ) {
297
+					if ( isset( $field[ 'default' ], $field[ 'meta_key' ], $data[ $field[ 'meta_key' ] ] ) ) {
298 298
 						// Remove default value if not applicable to the selected gateway.
299
-						if ( isset( $field['methods'] ) ) {
300
-							$clean_default = array_intersect( $settings, $field['methods'] );
299
+						if ( isset( $field[ 'methods' ] ) ) {
300
+							$clean_default = array_intersect( $settings, $field[ 'methods' ] );
301 301
 
302 302
 							if ( empty( $clean_default ) ) {
303
-								$meta_value = get_post_meta( $post_id, $field['meta_key'], true );
303
+								$meta_value = get_post_meta( $post_id, $field[ 'meta_key' ], true );
304 304
 
305 305
 								// Only remove value if not saved before.
306 306
 								if ( empty( $meta_value ) ) {
307
-									$data[ $field['meta_key'] ] = null;
307
+									$data[ $field[ 'meta_key' ] ] = null;
308 308
 
309 309
 									continue;
310 310
 								}
@@ -312,13 +312,13 @@  discard block
 block discarded – undo
312 312
 						}
313 313
 
314 314
 						// Set the default value if empty.
315
-						if ( empty( $data[ $field['meta_key'] ] ) ) {
316
-							$default = $field['default'];
315
+						if ( empty( $data[ $field[ 'meta_key' ] ] ) ) {
316
+							$default = $field[ 'default' ];
317 317
 
318
-							if ( is_array( $default ) && 2 === count( $default ) && Util::class_method_exists( $default[0], $default[1] ) ) {
319
-								$data[ $field['meta_key'] ] = call_user_func( $default, $field );
318
+							if ( is_array( $default ) && 2 === count( $default ) && Util::class_method_exists( $default[ 0 ], $default[ 1 ] ) ) {
319
+								$data[ $field[ 'meta_key' ] ] = call_user_func( $default, $field );
320 320
 							} else {
321
-								$data[ $field['meta_key'] ] = $default;
321
+								$data[ $field[ 'meta_key' ] ] = $default;
322 322
 							}
323 323
 						}
324 324
 					}
@@ -368,14 +368,14 @@  discard block
 block discarded – undo
368 368
 			0  => '', // Unused. Messages start at index 1.
369 369
 			1  => __( '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]=2352799&filters[translation_id]=37947229
371
-			2  => $messages['post'][2],
371
+			2  => $messages[ 'post' ][ 2 ],
372 372
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352800&filters[translation_id]=37947870
373
-			3  => $messages['post'][3],
373
+			3  => $messages[ 'post' ][ 3 ],
374 374
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352798&filters[translation_id]=37947230
375 375
 			4  => __( 'Configuration updated.', 'pronamic_ideal' ),
376 376
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352801&filters[translation_id]=37947231
377 377
 			// translators: %s: date and time of the revision.
378
-			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.
378
+			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.
379 379
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352802&filters[translation_id]=37949178
380 380
 			6  => __( 'Configuration published.', 'pronamic_ideal' ),
381 381
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352803&filters[translation_id]=37947232
Please login to merge, or discard this patch.
admin/page-dashboard.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -152,9 +152,12 @@
 block discarded – undo
152 152
 
153 153
 								<?php wp_reset_postdata(); ?>
154 154
 
155
-							<?php else : ?>
155
+							<?php else {
156
+	: ?>
156 157
 
157
-								<p><?php esc_html_e( 'No pending payments found.', 'pronamic_ideal' ); ?></p>
158
+								<p><?php esc_html_e( 'No pending payments found.', 'pronamic_ideal' );
159
+}
160
+?></p>
158 161
 
159 162
 							<?php endif; ?>
160 163
 						</div>
Please login to merge, or discard this patch.
classes/Plugin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
 		);
477 477
 
478 478
 		if ( $payment_method ) {
479
-			$args['post__in'] = PaymentMethods::get_config_ids( $payment_method );
479
+			$args[ 'post__in' ] = PaymentMethods::get_config_ids( $payment_method );
480 480
 		}
481 481
 
482 482
 		$query = new WP_Query( $args );
@@ -687,10 +687,10 @@  discard block
 block discarded – undo
687 687
 		$payment->set_credit_card( $data->get_credit_card() );
688 688
 
689 689
 		// User Agent (@see https://github.com/WordPress/WordPress/blob/4.9.4/wp-includes/comment.php#L1962-L1965).
690
-		$payment->user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : null;
690
+		$payment->user_agent = isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) ? $_SERVER[ 'HTTP_USER_AGENT' ] : null;
691 691
 
692 692
 		// IP (@see https://github.com/WordPress/WordPress/blob/4.9.4/wp-includes/comment.php#L1957-L1960).
693
-		$payment->user_ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : null;
693
+		$payment->user_ip = isset( $_SERVER[ 'REMOTE_ADDR' ] ) ? $_SERVER[ 'REMOTE_ADDR' ] : null;
694 694
 
695 695
 		return self::start_payment( $payment, $gateway );
696 696
 	}
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 
714 714
 		if ( empty( $amount ) ) {
715 715
 			// Keep track of free payments to update during shutdown.
716
-			pronamic_pay_plugin()->payments_module->free[] = $payment->get_id();
716
+			pronamic_pay_plugin()->payments_module->free[ ] = $payment->get_id();
717 717
 
718 718
 			return $payment;
719 719
 		}
Please login to merge, or discard this patch.
classes/Admin/AdminSubscriptionPostType.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
 		$screen = get_current_screen();
73 73
 
74 74
 		if ( self::POST_TYPE === $screen->post_type ) {
75
-			if ( ! isset( $vars['post_status'] ) ) {
76
-				$vars['post_status'] = array_keys( SubscriptionPostType::get_states() );
75
+			if ( ! isset( $vars[ 'post_status' ] ) ) {
76
+				$vars[ 'post_status' ] = array_keys( SubscriptionPostType::get_states() );
77 77
 
78
-				$vars['post_status'][] = 'publish';
78
+				$vars[ 'post_status' ][ ] = 'publish';
79 79
 			}
80 80
 		}
81 81
 
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
 	 * @return array
114 114
 	 */
115 115
 	public function sortable_columns( $sortable_columns ) {
116
-		$sortable_columns['pronamic_subscription_title'] = 'ID';
117
-		$sortable_columns['pronamic_subscription_date']  = 'date';
116
+		$sortable_columns[ 'pronamic_subscription_title' ] = 'ID';
117
+		$sortable_columns[ 'pronamic_subscription_date' ]  = 'date';
118 118
 
119 119
 		return $sortable_columns;
120 120
 	}
Please login to merge, or discard this patch.