Passed
Branch develop (73db2f)
by Remco
05:17
created
classes/GoogleAnalyticsEcommerce.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -163,11 +163,11 @@  discard block
 block discarded – undo
163 163
 	private function get_client_id( Payment $payment ) {
164 164
 		$client_id = $payment->get_analytics_client_id();
165 165
 
166
-		if ( ! empty( $client_id ) ) {
166
+		if ( !empty( $client_id ) ) {
167 167
 			return $client_id;
168 168
 		}
169 169
 
170
-		if ( ! empty( $this->client_id ) ) {
170
+		if ( !empty( $this->client_id ) ) {
171 171
 			return $this->client_id;
172 172
 		}
173 173
 
@@ -228,12 +228,12 @@  discard block
 block discarded – undo
228 228
 
229 229
 		$ga = explode( '.', $ga_cookie );
230 230
 
231
-		if ( isset( $ga[2] ) && GoogleAnalyticsEcommerce::is_uuid( $ga[2] ) ) {
231
+		if ( isset( $ga[ 2 ] ) && GoogleAnalyticsEcommerce::is_uuid( $ga[ 2 ] ) ) {
232 232
 			// Use UUID from cookie.
233
-			$client_id = $ga[2];
234
-		} elseif ( isset( $ga[2], $ga[3] ) ) {
233
+			$client_id = $ga[ 2 ];
234
+		} elseif ( isset( $ga[ 2 ], $ga[ 3 ] ) ) {
235 235
 			// Older Google Client ID.
236
-			$client_id = sprintf( '%s.%s', $ga[2], $ga[3] );
236
+			$client_id = sprintf( '%s.%s', $ga[ 2 ], $ga[ 3 ] );
237 237
 		}
238 238
 
239 239
 		return $client_id;
Please login to merge, or discard this patch.
classes/Payments/PaymentData.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -219,13 +219,13 @@
 block discarded – undo
219 219
 	 * @return string
220 220
 	 */
221 221
 	public function get_subscription_id() {
222
-		if ( ! $this->get_subscription() ) {
222
+		if ( !$this->get_subscription() ) {
223 223
 			return;
224 224
 		}
225 225
 
226 226
 		$payment = get_pronamic_payment_by_meta( '_pronamic_payment_source_id', $this->get_subscription_source_id() );
227 227
 
228
-		if ( ! $payment ) {
228
+		if ( !$payment ) {
229 229
 			return;
230 230
 		}
231 231
 
Please login to merge, or discard this patch.
classes/Payments/PaymentsDataStoreCPT.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 		$post_status = $this->get_post_status( $payment, null );
104 104
 
105 105
 		if ( null !== $post_status ) {
106
-			$data['post_status'] = $post_status;
106
+			$data[ 'post_status' ] = $post_status;
107 107
 		}
108 108
 
109 109
 		wp_update_post( $data );
@@ -147,52 +147,52 @@  discard block
 block discarded – undo
147 147
 
148 148
 		$id = $payment->get_id();
149 149
 
150
-		$payment->config_id = get_post_meta( $id, $prefix . 'config_id', true );
151
-		$payment->key       = get_post_meta( $id, $prefix . 'key', true );
150
+		$payment->config_id = get_post_meta( $id, $prefix.'config_id', true );
151
+		$payment->key       = get_post_meta( $id, $prefix.'key', true );
152 152
 
153
-		$payment->amount   = (float) get_post_meta( $id, $prefix . 'amount', true );
154
-		$payment->currency = get_post_meta( $id, $prefix . 'currency', true );
155
-		$payment->method   = get_post_meta( $id, $prefix . 'method', true );
156
-		$payment->issuer   = get_post_meta( $id, $prefix . 'issuer', true );
153
+		$payment->amount   = (float) get_post_meta( $id, $prefix.'amount', true );
154
+		$payment->currency = get_post_meta( $id, $prefix.'currency', true );
155
+		$payment->method   = get_post_meta( $id, $prefix.'method', true );
156
+		$payment->issuer   = get_post_meta( $id, $prefix.'issuer', true );
157 157
 
158
-		$payment->order_id       = get_post_meta( $id, $prefix . 'order_id', true );
159
-		$payment->transaction_id = get_post_meta( $id, $prefix . 'transaction_id', true );
160
-		$payment->entrance_code  = get_post_meta( $id, $prefix . 'entrance_code', true );
161
-		$payment->action_url     = get_post_meta( $id, $prefix . 'action_url', true );
158
+		$payment->order_id       = get_post_meta( $id, $prefix.'order_id', true );
159
+		$payment->transaction_id = get_post_meta( $id, $prefix.'transaction_id', true );
160
+		$payment->entrance_code  = get_post_meta( $id, $prefix.'entrance_code', true );
161
+		$payment->action_url     = get_post_meta( $id, $prefix.'action_url', true );
162 162
 
163
-		$payment->source      = get_post_meta( $id, $prefix . 'source', true );
164
-		$payment->source_id   = get_post_meta( $id, $prefix . 'source_id', true );
165
-		$payment->description = get_post_meta( $id, $prefix . 'description', true );
163
+		$payment->source      = get_post_meta( $id, $prefix.'source', true );
164
+		$payment->source_id   = get_post_meta( $id, $prefix.'source_id', true );
165
+		$payment->description = get_post_meta( $id, $prefix.'description', true );
166 166
 
167
-		$payment->language = get_post_meta( $id, $prefix . 'language', true );
168
-		$payment->locale   = get_post_meta( $id, $prefix . 'locale', true );
169
-		$payment->email    = get_post_meta( $id, $prefix . 'email', true );
167
+		$payment->language = get_post_meta( $id, $prefix.'language', true );
168
+		$payment->locale   = get_post_meta( $id, $prefix.'locale', true );
169
+		$payment->email    = get_post_meta( $id, $prefix.'email', true );
170 170
 
171
-		$payment->status = get_post_meta( $id, $prefix . 'status', true );
171
+		$payment->status = get_post_meta( $id, $prefix.'status', true );
172 172
 
173
-		$payment->customer_name       = get_post_meta( $id, $prefix . 'customer_name', true );
174
-		$payment->address             = get_post_meta( $id, $prefix . 'address', true );
175
-		$payment->zip                 = get_post_meta( $id, $prefix . 'zip', true );
176
-		$payment->city                = get_post_meta( $id, $prefix . 'city', true );
177
-		$payment->country             = get_post_meta( $id, $prefix . 'country', true );
178
-		$payment->telephone_number    = get_post_meta( $id, $prefix . 'telephone_number', true );
179
-		$payment->analytics_client_id = get_post_meta( $id, $prefix . 'analytics_client_id', true );
173
+		$payment->customer_name       = get_post_meta( $id, $prefix.'customer_name', true );
174
+		$payment->address             = get_post_meta( $id, $prefix.'address', true );
175
+		$payment->zip                 = get_post_meta( $id, $prefix.'zip', true );
176
+		$payment->city                = get_post_meta( $id, $prefix.'city', true );
177
+		$payment->country             = get_post_meta( $id, $prefix.'country', true );
178
+		$payment->telephone_number    = get_post_meta( $id, $prefix.'telephone_number', true );
179
+		$payment->analytics_client_id = get_post_meta( $id, $prefix.'analytics_client_id', true );
180 180
 
181
-		$payment->subscription_id = get_post_meta( $id, $prefix . 'subscription_id', true );
182
-		$payment->recurring_type  = get_post_meta( $id, $prefix . 'recurring_type', true );
183
-		$payment->recurring       = get_post_meta( $id, $prefix . 'recurring', true );
181
+		$payment->subscription_id = get_post_meta( $id, $prefix.'subscription_id', true );
182
+		$payment->recurring_type  = get_post_meta( $id, $prefix.'recurring_type', true );
183
+		$payment->recurring       = get_post_meta( $id, $prefix.'recurring', true );
184 184
 
185 185
 		// Start Date.
186
-		$start_date_string = get_post_meta( $id, $prefix . 'start_date', true );
186
+		$start_date_string = get_post_meta( $id, $prefix.'start_date', true );
187 187
 
188
-		if ( ! empty( $start_date_string ) ) {
188
+		if ( !empty( $start_date_string ) ) {
189 189
 			$payment->start_date = date_create( $start_date_string );
190 190
 		}
191 191
 
192 192
 		// End Date.
193
-		$end_date_string = get_post_meta( $id, $prefix . 'end_date', true );
193
+		$end_date_string = get_post_meta( $id, $prefix.'end_date', true );
194 194
 
195
-		if ( ! empty( $end_date_string ) ) {
195
+		if ( !empty( $end_date_string ) ) {
196 196
 			$payment->end_date = date_create( $end_date_string );
197 197
 		}
198 198
 	}
@@ -249,18 +249,18 @@  discard block
 block discarded – undo
249 249
 		);
250 250
 
251 251
 		if ( isset( $payment->start_date ) ) {
252
-			$data['start_date'] = $payment->start_date->format( 'Y-m-d H:i:s' );
252
+			$data[ 'start_date' ] = $payment->start_date->format( 'Y-m-d H:i:s' );
253 253
 		}
254 254
 
255 255
 		if ( isset( $payment->end_date ) ) {
256
-			$data['end_date'] = $payment->end_date->format( 'Y-m-d H:i:s' );
256
+			$data[ 'end_date' ] = $payment->end_date->format( 'Y-m-d H:i:s' );
257 257
 		}
258 258
 
259 259
 		$data = array_merge( $payment->meta, $data );
260 260
 
261 261
 		foreach ( $data as $key => $value ) {
262
-			if ( ! empty( $value ) ) {
263
-				$meta_key = $prefix . $key;
262
+			if ( !empty( $value ) ) {
263
+				$meta_key = $prefix.$key;
264 264
 
265 265
 				update_post_meta( $payment->get_id(), $meta_key, $value );
266 266
 			}
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 		if ( $previous_status !== $payment->status ) {
270 270
 			$can_redirect = false;
271 271
 
272
-			do_action( 'pronamic_payment_status_update_' . $payment->source . '_' . $previous_status . '_to_' . $payment->status, $payment, $can_redirect );
273
-			do_action( 'pronamic_payment_status_update_' . $payment->source, $payment, $can_redirect );
272
+			do_action( 'pronamic_payment_status_update_'.$payment->source.'_'.$previous_status.'_to_'.$payment->status, $payment, $can_redirect );
273
+			do_action( 'pronamic_payment_status_update_'.$payment->source, $payment, $can_redirect );
274 274
 			do_action( 'pronamic_payment_status_update', $payment, $can_redirect );
275 275
 		}
276 276
 	}
Please login to merge, or discard this patch.
classes/Payments/Payment.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -422,9 +422,9 @@  discard block
 block discarded – undo
422 422
 	 * @return string
423 423
 	 */
424 424
 	public function get_source_text() {
425
-		$text = $this->get_source() . '<br />' . $this->get_source_id();
425
+		$text = $this->get_source().'<br />'.$this->get_source_id();
426 426
 
427
-		$text = apply_filters( 'pronamic_payment_source_text_' . $this->get_source(), $text, $this );
427
+		$text = apply_filters( 'pronamic_payment_source_text_'.$this->get_source(), $text, $this );
428 428
 		$text = apply_filters( 'pronamic_payment_source_text', $text, $this );
429 429
 
430 430
 		return $text;
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 	 * @return mixed
557 557
 	 */
558 558
 	public function get_meta( $key ) {
559
-		$key = '_pronamic_payment_' . $key;
559
+		$key = '_pronamic_payment_'.$key;
560 560
 
561 561
 		return get_post_meta( $this->id, $key, true );
562 562
 	}
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 		$url = home_url( '/' );
634 634
 
635 635
 		$url = apply_filters( 'pronamic_payment_redirect_url', $url, $this );
636
-		$url = apply_filters( 'pronamic_payment_redirect_url_' . $this->source, $url, $this );
636
+		$url = apply_filters( 'pronamic_payment_redirect_url_'.$this->source, $url, $this );
637 637
 
638 638
 		return $url;
639 639
 	}
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 		$description = $this->source;
660 660
 
661 661
 		$description = apply_filters( 'pronamic_payment_source_description', $description, $this );
662
-		$description = apply_filters( 'pronamic_payment_source_description_' . $this->source, $description, $this );
662
+		$description = apply_filters( 'pronamic_payment_source_description_'.$this->source, $description, $this );
663 663
 
664 664
 		return $description;
665 665
 	}
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
 		$url = null;
674 674
 
675 675
 		$url = apply_filters( 'pronamic_payment_source_url', $url, $this );
676
-		$url = apply_filters( 'pronamic_payment_source_url_' . $this->source, $url, $this );
676
+		$url = apply_filters( 'pronamic_payment_source_url_'.$this->source, $url, $this );
677 677
 
678 678
 		return $url;
679 679
 	}
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
 		$gateway_id = get_post_meta( $config_id, '_pronamic_gateway_id', true );
691 691
 
692 692
 		$url = apply_filters( 'pronamic_payment_provider_url', $url, $this );
693
-		$url = apply_filters( 'pronamic_payment_provider_url_' . $gateway_id, $url, $this );
693
+		$url = apply_filters( 'pronamic_payment_provider_url_'.$gateway_id, $url, $this );
694 694
 
695 695
 		return $url;
696 696
 	}
Please login to merge, or discard this patch.
classes/Payments/PaymentTestData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
 	public function get_subscription() {
150 150
 		$test_subscription = filter_input( INPUT_POST, 'pronamic_pay_test_subscription', FILTER_VALIDATE_BOOLEAN );
151 151
 
152
-		if ( ! $test_subscription ) {
152
+		if ( !$test_subscription ) {
153 153
 			return false;
154 154
 		}
155 155
 
Please login to merge, or discard this patch.
classes/LicenseManager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		$data = get_transient( 'pronamic_pay_license_data' );
51 51
 
52 52
 		if ( $data ) {
53
-			include $this->plugin->get_plugin_dir_path() . 'admin/notice-license.php';
53
+			include $this->plugin->get_plugin_dir_path().'admin/notice-license.php';
54 54
 
55 55
 			delete_transient( 'pronamic_pay_license_data' );
56 56
 		}
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
 		if ( $newvalue !== $oldvalue ) {
70 70
 			delete_option( 'pronamic_pay_license_status' );
71 71
 
72
-			if ( ! empty( $oldvalue ) ) {
72
+			if ( !empty( $oldvalue ) ) {
73 73
 				$this->deactivate_license( $oldvalue );
74 74
 			}
75 75
 		}
76 76
 
77 77
 		delete_transient( 'pronamic_pay_license_data' );
78 78
 
79
-		if ( ! empty( $newvalue ) ) {
79
+		if ( !empty( $newvalue ) ) {
80 80
 			// Always try to activate the new license, it could be deactivated.
81 81
 			$this->activate_license( $newvalue );
82 82
 		}
Please login to merge, or discard this patch.
classes/Forms/FormShortcode.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 			), $atts, 'pronamic_payment_form'
47 47
 		);
48 48
 
49
-		$id = $atts['id'];
49
+		$id = $atts[ 'id' ];
50 50
 
51 51
 		return $this->forms_module->get_form_output( $id );
52 52
 	}
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 * Shortcode user interface register.
56 56
 	 */
57 57
 	public function shortcode_ui_register() {
58
-		if ( ! function_exists( 'shortcode_ui_register_for_shortcode' ) ) {
58
+		if ( !function_exists( 'shortcode_ui_register_for_shortcode' ) ) {
59 59
 			return;
60 60
 		}
61 61
 
Please login to merge, or discard this patch.
classes/Forms/FormPostType.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 		 */
61 61
 		add_action( 'init', array( $this, 'register_post_type' ), 0 ); // Highest priority.
62 62
 
63
-		add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'edit_columns' ) );
63
+		add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'edit_columns' ) );
64 64
 
65
-		add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
65
+		add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
66 66
 
67 67
 		/*
68 68
 		 * Add meta box, we use priority 9 to make sure it loads before Yoast SEO meta box.
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 		 */
71 71
 		add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 9 );
72 72
 
73
-		add_action( 'save_post_' . self::POST_TYPE, array( $this, 'save_post' ) );
73
+		add_action( 'save_post_'.self::POST_TYPE, array( $this, 'save_post' ) );
74 74
 
75 75
 		add_action( 'post_submitbox_misc_actions', array( $this, 'post_submitbox_misc_actions' ) );
76 76
 	}
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			case 'pronamic_payment_form_gateway':
153 153
 				$config_id = get_post_meta( $post_id, '_pronamic_payment_form_config_id', true );
154 154
 
155
-				if ( ! empty( $config_id ) ) {
155
+				if ( !empty( $config_id ) ) {
156 156
 					echo get_the_title( $config_id );
157 157
 				} else {
158 158
 					echo '—';
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	 * @param WP_Post $post The object for the current post/page.
268 268
 	 */
269 269
 	public function meta_box_form_options( $post ) {
270
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-form-options.php';
270
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-form-options.php';
271 271
 	}
272 272
 
273 273
 	/**
@@ -277,14 +277,14 @@  discard block
 block discarded – undo
277 277
 	 */
278 278
 	public function save_post( $post_id ) {
279 279
 		// Check if our nonce is set.
280
-		if ( ! filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) {
280
+		if ( !filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) {
281 281
 			return $post_id;
282 282
 		}
283 283
 
284 284
 		$nonce = filter_input( INPUT_POST, 'pronamic_pay_nonce', FILTER_SANITIZE_STRING );
285 285
 
286 286
 		// Verify that the nonce is valid.
287
-		if ( ! wp_verify_nonce( $nonce, 'pronamic_pay_save_form_options' ) ) {
287
+		if ( !wp_verify_nonce( $nonce, 'pronamic_pay_save_form_options' ) ) {
288 288
 			return $post_id;
289 289
 		}
290 290
 
@@ -307,15 +307,15 @@  discard block
 block discarded – undo
307 307
 		$data = filter_input_array( INPUT_POST, $definition );
308 308
 
309 309
 		// Convert amount choices to cents.
310
-		if ( isset( $data['_pronamic_payment_form_amount_choices'] ) ) {
311
-			foreach ( $data['_pronamic_payment_form_amount_choices'] as $i => $amount ) {
310
+		if ( isset( $data[ '_pronamic_payment_form_amount_choices' ] ) ) {
311
+			foreach ( $data[ '_pronamic_payment_form_amount_choices' ] as $i => $amount ) {
312 312
 				$amount = \Pronamic\WordPress\Pay\Core\Util::string_to_amount( $amount );
313 313
 
314
-				$data['_pronamic_payment_form_amount_choices'][ $i ] = \Pronamic\WordPress\Pay\Core\Util::amount_to_cents( $amount );
314
+				$data[ '_pronamic_payment_form_amount_choices' ][ $i ] = \Pronamic\WordPress\Pay\Core\Util::amount_to_cents( $amount );
315 315
 			}
316 316
 
317 317
 			// Remove empty choices.
318
-			$data['_pronamic_payment_form_amount_choices'] = array_filter( $data['_pronamic_payment_form_amount_choices'] );
318
+			$data[ '_pronamic_payment_form_amount_choices' ] = array_filter( $data[ '_pronamic_payment_form_amount_choices' ] );
319 319
 		}
320 320
 
321 321
 		// Update post meta data.
Please login to merge, or discard this patch.
classes/Forms/FormsModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * @return string
70 70
 	 */
71 71
 	public function get_form_output( $id ) {
72
-		$file = plugin_dir_path( Plugin::$file ) . 'templates/form.php';
72
+		$file = plugin_dir_path( Plugin::$file ).'templates/form.php';
73 73
 
74 74
 		ob_start();
75 75
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 * @return string
89 89
 	 */
90 90
 	public function source_text( $text, Payment $payment ) {
91
-		$text = __( 'Payment Form', 'pronamic_ideal' ) . '<br />';
91
+		$text = __( 'Payment Form', 'pronamic_ideal' ).'<br />';
92 92
 
93 93
 		$text .= sprintf(
94 94
 			'<a href="%s">%s</a>',
Please login to merge, or discard this patch.