Passed
Push — develop ( 5be752...aeeb2a )
by Remco
04:20
created
admin/meta-box-gateway-config.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 }
21 21
 
22 22
 foreach ( $fields as $id => $field ) {
23
-	$section = $field['section'];
23
+	$section = $field[ 'section' ];
24 24
 
25 25
 	$sections_fields[ $section ][ $id ] = $field;
26 26
 }
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
 					<?php
51 51
 
52 52
 					foreach ( $pronamic_pay_providers as $provider ) {
53
-						if ( isset( $provider['integrations'] ) && is_array( $provider['integrations'] ) ) {
54
-							printf( '<optgroup label="%s">', esc_attr( $provider['name'] ) );
53
+						if ( isset( $provider[ 'integrations' ] ) && is_array( $provider[ 'integrations' ] ) ) {
54
+							printf( '<optgroup label="%s">', esc_attr( $provider[ 'name' ] ) );
55 55
 
56
-							foreach ( $provider['integrations'] as $integration ) {
56
+							foreach ( $provider[ 'integrations' ] as $integration ) {
57 57
 								$id          = $integration->get_id();
58 58
 								$name        = $integration->get_name();
59 59
 								$classes     = array();
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 								$links       = array();
62 62
 
63 63
 								if ( isset( $integration->deprecated ) && $integration->deprecated ) {
64
-									$classes[] = 'deprecated';
64
+									$classes[ ] = 'deprecated';
65 65
 
66 66
 									$name = sprintf( __( '%s (obsoleted)', 'pronamic_ideal' ), $name );
67 67
 
@@ -74,23 +74,23 @@  discard block
 block discarded – undo
74 74
 								$dashboards = $integration->get_dashboard_url();
75 75
 
76 76
 								if ( 1 === count( $dashboards ) ) {
77
-									$links[] = sprintf(
77
+									$links[ ] = sprintf(
78 78
 										'<a href="%s" title="%s">%2$s</a>',
79
-										esc_attr( $dashboards[0] ),
79
+										esc_attr( $dashboards[ 0 ] ),
80 80
 										__( 'Dashboard', 'pronamic_ideal' )
81 81
 									);
82 82
 								} elseif ( count( $dashboards ) > 1 ) {
83 83
 									$dashboard_urls = array();
84 84
 
85 85
 									foreach ( $dashboards as $dashboard_name => $dashboard_url ) {
86
-										$dashboard_urls[] = sprintf(
86
+										$dashboard_urls[ ] = sprintf(
87 87
 											'<a href="%s" title="%s">%2$s</a>',
88 88
 											esc_attr( $dashboard_url ),
89 89
 											esc_html( ucfirst( $dashboard_name ) )
90 90
 										);
91 91
 									}
92 92
 
93
-									$links[] = sprintf(
93
+									$links[ ] = sprintf(
94 94
 										'%s: %s',
95 95
 										__( 'Dashboards', 'pronamic_ideal' ),
96 96
 										strtolower( implode( ', ', $dashboard_urls ) )
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 								// Product link.
101 101
 								if ( $integration->get_product_url() ) {
102
-									$links[] = sprintf(
102
+									$links[ ] = sprintf(
103 103
 										'<a href="%s" target="_blank" title="%s">%2$s</a>',
104 104
 										$integration->get_product_url(),
105 105
 										__( 'Product information', 'pronamic_ideal' )
@@ -139,34 +139,34 @@  discard block
 block discarded – undo
139 139
 			<?php
140 140
 
141 141
 			$classes = array();
142
-			if ( isset( $section['methods'] ) ) {
143
-				$classes[] = 'pronamic-pay-tab';
144
-				$classes[] = 'pronamic-pay-cloack';
145
-				$classes[] = 'extra-settings';
142
+			if ( isset( $section[ 'methods' ] ) ) {
143
+				$classes[ ] = 'pronamic-pay-tab';
144
+				$classes[ ] = 'pronamic-pay-cloack';
145
+				$classes[ ] = 'extra-settings';
146 146
 
147
-				foreach ( $section['methods'] as $method ) {
148
-					$classes[] = 'setting-' . $method;
147
+				foreach ( $section[ 'methods' ] as $method ) {
148
+					$classes[ ] = 'setting-'.$method;
149 149
 				}
150 150
 			}
151 151
 
152 152
 			?>
153 153
 
154 154
 			<div class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
155
-				<?php if ( ! empty( $section['title'] ) || ! empty( $section['description'] ) ) : ?>
155
+				<?php if ( !empty( $section[ 'title' ] ) || !empty( $section[ 'description' ] ) ) : ?>
156 156
 
157 157
 					<div class="pronamic-pay-tab-block gateway-config-section-header">
158
-						<?php if ( ! empty( $section['title'] ) ) : ?>
158
+						<?php if ( !empty( $section[ 'title' ] ) ) : ?>
159 159
 
160
-							<h4 class="pronamic-pay-cloack"><?php echo esc_html( $section['title'] ); ?></h4>
160
+							<h4 class="pronamic-pay-cloack"><?php echo esc_html( $section[ 'title' ] ); ?></h4>
161 161
 
162 162
 						<?php endif; ?>
163 163
 
164
-						<?php if ( ! empty( $section['description'] ) ) : ?>
164
+						<?php if ( !empty( $section[ 'description' ] ) ) : ?>
165 165
 
166 166
 							<p>
167 167
 								<?php
168 168
 
169
-								echo $section['description']; // WPCS: XSS ok.
169
+								echo $section[ 'description' ]; // WPCS: XSS ok.
170 170
 
171 171
 								?>
172 172
 							</p>
@@ -183,23 +183,23 @@  discard block
 block discarded – undo
183 183
 					foreach ( $sections_fields[ $id ] as $field ) :
184 184
 
185 185
 						$classes = array();
186
-						if ( isset( $field['methods'] ) ) {
187
-							$classes[] = 'pronamic-pay-cloack';
188
-							$classes[] = 'extra-settings';
186
+						if ( isset( $field[ 'methods' ] ) ) {
187
+							$classes[ ] = 'pronamic-pay-cloack';
188
+							$classes[ ] = 'extra-settings';
189 189
 
190
-							foreach ( $field['methods'] as $method ) {
191
-								$classes[] = 'setting-' . $method;
190
+							foreach ( $field[ 'methods' ] as $method ) {
191
+								$classes[ ] = 'setting-'.$method;
192 192
 							}
193 193
 						}
194 194
 
195
-						if ( isset( $field['group'] ) ) {
196
-							$classes[] = $field['group'];
195
+						if ( isset( $field[ 'group' ] ) ) {
196
+							$classes[ ] = $field[ 'group' ];
197 197
 						}
198 198
 
199
-						if ( isset( $field['id'] ) ) {
200
-							$id = $field['id'];
201
-						} elseif ( isset( $field['meta_key'] ) ) {
202
-							$id = $field['meta_key'];
199
+						if ( isset( $field[ 'id' ] ) ) {
200
+							$id = $field[ 'id' ];
201
+						} elseif ( isset( $field[ 'meta_key' ] ) ) {
202
+							$id = $field[ 'meta_key' ];
203 203
 						} else {
204 204
 							$id = uniqid();
205 205
 						}
@@ -207,19 +207,19 @@  discard block
 block discarded – undo
207 207
 						?>
208 208
 						<tr class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
209 209
 
210
-							<?php if ( 'html' !== $field['type'] ) { ?>
210
+							<?php if ( 'html' !== $field[ 'type' ] ) { ?>
211 211
 
212 212
 							<th scope="row">
213 213
 								<label for="<?php echo esc_attr( $id ); ?>">
214
-									<?php echo esc_html( $field['title'] ); ?>
214
+									<?php echo esc_html( $field[ 'title' ] ); ?>
215 215
 								</label>
216 216
 
217 217
 								<?php
218 218
 
219
-								if ( isset( $field['tooltip'] ) && ! empty( $field['tooltip'] ) ) {
219
+								if ( isset( $field[ 'tooltip' ] ) && !empty( $field[ 'tooltip' ] ) ) {
220 220
 									printf(
221 221
 										'<span class="dashicons dashicons-editor-help pronamic-pay-tip" title="%s"></span>',
222
-										esc_attr( $field['tooltip'] )
222
+										esc_attr( $field[ 'tooltip' ] )
223 223
 									);
224 224
 								}
225 225
 
@@ -228,59 +228,59 @@  discard block
 block discarded – undo
228 228
 
229 229
 							<?php } ?>
230 230
 
231
-							<td <?php if ( 'html' === $field['type'] ) : ?>colspan="2"<?php endif; ?>>
231
+							<td <?php if ( 'html' === $field[ 'type' ] ) : ?>colspan="2"<?php endif; ?>>
232 232
 								<?php
233 233
 
234 234
 								$attributes         = array();
235
-								$attributes['id']   = $id;
236
-								$attributes['name'] = $id;
235
+								$attributes[ 'id' ]   = $id;
236
+								$attributes[ 'name' ] = $id;
237 237
 
238 238
 								$classes = array();
239
-								if ( isset( $field['classes'] ) ) {
240
-									$classes = $field['classes'];
239
+								if ( isset( $field[ 'classes' ] ) ) {
240
+									$classes = $field[ 'classes' ];
241 241
 								}
242 242
 
243
-								if ( isset( $field['readonly'] ) && $field['readonly'] ) {
244
-									$attributes['readonly'] = 'readonly';
243
+								if ( isset( $field[ 'readonly' ] ) && $field[ 'readonly' ] ) {
244
+									$attributes[ 'readonly' ] = 'readonly';
245 245
 
246
-									$classes[] = 'readonly';
246
+									$classes[ ] = 'readonly';
247 247
 								}
248 248
 
249
-								if ( isset( $field['size'] ) ) {
250
-									$attributes['size'] = $field['size'];
249
+								if ( isset( $field[ 'size' ] ) ) {
250
+									$attributes[ 'size' ] = $field[ 'size' ];
251 251
 								}
252 252
 
253
-								if ( in_array( $field['type'], array( 'text', 'password', 'textarea', 'select' ), true ) ) {
254
-									$classes[] = 'pronamic-pay-form-control';
253
+								if ( in_array( $field[ 'type' ], array( 'text', 'password', 'textarea', 'select' ), true ) ) {
254
+									$classes[ ] = 'pronamic-pay-form-control';
255 255
 								}
256 256
 
257
-								if ( in_array( $field['type'], array( 'textarea' ), true ) ) {
258
-									$classes[] = 'pronamic-pay-form-control-lg';
257
+								if ( in_array( $field[ 'type' ], array( 'textarea' ), true ) ) {
258
+									$classes[ ] = 'pronamic-pay-form-control-lg';
259 259
 								}
260 260
 
261
-								if ( ! empty( $classes ) ) {
262
-									$attributes['class'] = implode( ' ', $classes );
261
+								if ( !empty( $classes ) ) {
262
+									$attributes[ 'class' ] = implode( ' ', $classes );
263 263
 								}
264 264
 
265 265
 								$value = '';
266
-								if ( isset( $field['meta_key'] ) ) {
267
-									$attributes['name'] = $field['meta_key'];
266
+								if ( isset( $field[ 'meta_key' ] ) ) {
267
+									$attributes[ 'name' ] = $field[ 'meta_key' ];
268 268
 
269
-									$value = get_post_meta( get_the_ID(), $field['meta_key'], true );
270
-								} elseif ( isset( $field['value'] ) ) {
271
-									$value = $field['value'];
269
+									$value = get_post_meta( get_the_ID(), $field[ 'meta_key' ], true );
270
+								} elseif ( isset( $field[ 'value' ] ) ) {
271
+									$value = $field[ 'value' ];
272 272
 								}
273 273
 
274 274
 								// Set default.
275
-								if ( empty( $value ) && isset( $field['default'] ) ) {
276
-									$value = $field['default'];
275
+								if ( empty( $value ) && isset( $field[ 'default' ] ) ) {
276
+									$value = $field[ 'default' ];
277 277
 								}
278 278
 
279
-								switch ( $field['type'] ) {
279
+								switch ( $field[ 'type' ] ) {
280 280
 									case 'text':
281 281
 									case 'password':
282
-										$attributes['type']  = $field['type'];
283
-										$attributes['value'] = $value;
282
+										$attributes[ 'type' ]  = $field[ 'type' ];
283
+										$attributes[ 'value' ] = $value;
284 284
 
285 285
 										printf(
286 286
 											'<input %s />',
@@ -291,8 +291,8 @@  discard block
 block discarded – undo
291 291
 
292 292
 										break;
293 293
 									case 'checkbox':
294
-										$attributes['type']  = $field['type'];
295
-										$attributes['value'] = '1';
294
+										$attributes[ 'type' ]  = $field[ 'type' ];
295
+										$attributes[ 'value' ] = '1';
296 296
 
297 297
 										printf(
298 298
 											'<input %s %s />',
@@ -306,14 +306,14 @@  discard block
 block discarded – undo
306 306
 
307 307
 										printf(
308 308
 											'<label for="%s">%s</label>',
309
-											esc_attr( $attributes['id'] ),
310
-											esc_html( $field['label'] )
309
+											esc_attr( $attributes[ 'id' ] ),
310
+											esc_html( $field[ 'label' ] )
311 311
 										);
312 312
 
313 313
 										break;
314 314
 									case 'textarea':
315
-										$attributes['rows'] = 4;
316
-										$attributes['cols'] = 65;
315
+										$attributes[ 'rows' ] = 4;
316
+										$attributes[ 'cols' ] = 65;
317 317
 
318 318
 										printf(
319 319
 											'<textarea %s />%s</textarea>',
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 
326 326
 										break;
327 327
 									case 'file':
328
-										$attributes['type'] = 'file';
328
+										$attributes[ 'type' ] = 'file';
329 329
 
330 330
 										printf(
331 331
 											'<input %s />',
@@ -340,22 +340,22 @@  discard block
 block discarded – undo
340 340
 											'<select %s>%s</select>',
341 341
 											// @codingStandardsIgnoreStart
342 342
 											Util::array_to_html_attributes( $attributes ),
343
-											Util::select_options_grouped( $field['options'], $value )
343
+											Util::select_options_grouped( $field[ 'options' ], $value )
344 344
 											// @codingStandardsIgnoreEnd
345 345
 										);
346 346
 
347 347
 										break;
348 348
 									case 'optgroup':
349 349
 										printf( '<fieldset>' );
350
-										printf( '<legend class="screen-reader-text">%s</legend>', esc_html( $field['title'] ) );
350
+										printf( '<legend class="screen-reader-text">%s</legend>', esc_html( $field[ 'title' ] ) );
351 351
 
352
-										foreach ( $field['options'] as $key => $label ) {
352
+										foreach ( $field[ 'options' ] as $key => $label ) {
353 353
 											printf(
354 354
 												'<label>%s %s</label><br />',
355 355
 												sprintf(
356 356
 													'<input type="radio" value="%s" name="%s" %s />',
357 357
 													esc_attr( $key ),
358
-													esc_attr( $attributes['name'] ),
358
+													esc_attr( $attributes[ 'name' ] ),
359 359
 													checked( $value, $key, false )
360 360
 												),
361 361
 												esc_html( $label )
@@ -365,26 +365,26 @@  discard block
 block discarded – undo
365 365
 										break;
366 366
 								}
367 367
 
368
-								if ( isset( $field['html'] ) ) {
369
-									if ( 'description' !== $field['type'] && isset( $field['title'] ) && ! empty( $field['title'] ) ) {
368
+								if ( isset( $field[ 'html' ] ) ) {
369
+									if ( 'description' !== $field[ 'type' ] && isset( $field[ 'title' ] ) && !empty( $field[ 'title' ] ) ) {
370 370
 										printf(
371 371
 											'<strong>%s</strong><br>',
372
-											esc_html( $field['title'] )
372
+											esc_html( $field[ 'title' ] )
373 373
 										);
374 374
 									}
375 375
 
376
-									echo $field['html']; // WPCS: XSS ok.
376
+									echo $field[ 'html' ]; // WPCS: XSS ok.
377 377
 								}
378 378
 
379
-								if ( isset( $field['description'] ) ) {
379
+								if ( isset( $field[ 'description' ] ) ) {
380 380
 									printf( // WPCS: XSS ok.
381 381
 										'<p class="pronamic-pay-description description">%s</p>',
382
-										$field['description']
382
+										$field[ 'description' ]
383 383
 									);
384 384
 								}
385 385
 
386
-								if ( isset( $field['callback'] ) ) {
387
-									$callback = $field['callback'];
386
+								if ( isset( $field[ 'callback' ] ) ) {
387
+									$callback = $field[ 'callback' ];
388 388
 
389 389
 									call_user_func( $callback, $field );
390 390
 								}
Please login to merge, or discard this patch.
classes/Admin/GatewaySettings.php 1 patch
Spacing   +4 added lines, -4 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' ),
@@ -149,6 +149,6 @@  discard block
 block discarded – undo
149 149
 
150 150
 		array_multisort( $sort, $sort_flags, $payment_methods );
151 151
 
152
-		require Plugin::$dirname . '/admin/meta-box-gateway-config-payment-methods.php';
152
+		require Plugin::$dirname.'/admin/meta-box-gateway-config-payment-methods.php';
153 153
 	}
154 154
 }
Please login to merge, or discard this patch.
classes/Admin/GatewayPostType.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
 	public function __construct( AdminModule $admin ) {
38 38
 		$this->admin = $admin;
39 39
 
40
-		add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'edit_columns' ) );
40
+		add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'edit_columns' ) );
41 41
 
42
-		add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
42
+		add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
43 43
 
44 44
 		add_action( 'post_edit_form_tag', array( $this, 'post_edit_form_tag' ) );
45 45
 
46 46
 		add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
47 47
 
48
-		add_action( 'save_post_' . self::POST_TYPE, array( $this, 'save_post' ) );
48
+		add_action( 'save_post_'.self::POST_TYPE, array( $this, 'save_post' ) );
49 49
 
50 50
 		add_action( 'display_post_states', array( $this, 'display_post_states' ), 10, 2 );
51 51
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 							$name = __( 'Dashboard', 'pronamic_ideal' );
144 144
 						}
145 145
 
146
-						$content[] = sprintf(
146
+						$content[ ] = sprintf(
147 147
 							'<a href="%s" target="_blank">%s</a>',
148 148
 							esc_attr( $url ),
149 149
 							esc_html( ucfirst( $name ) )
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 		}
170 170
 
171 171
 		if ( intval( get_option( 'pronamic_pay_config_id' ) ) === $post->ID ) {
172
-			$post_states['pronamic_pay_config_default'] = __( 'Default', 'pronamic_ideal' );
172
+			$post_states[ 'pronamic_pay_config_default' ] = __( 'Default', 'pronamic_ideal' );
173 173
 		}
174 174
 
175 175
 		return $post_states;
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 	public function meta_box_config( $post ) {
231 231
 		wp_nonce_field( 'pronamic_pay_save_gateway', 'pronamic_pay_nonce' );
232 232
 
233
-		include Plugin::$dirname . '/admin/meta-box-gateway-config.php';
233
+		include Plugin::$dirname.'/admin/meta-box-gateway-config.php';
234 234
 	}
235 235
 
236 236
 	/**
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	 * @param WP_Post $post The object for the current post/page.
240 240
 	 */
241 241
 	public function meta_box_test( $post ) {
242
-		include Plugin::$dirname . '/admin/meta-box-gateway-test.php';
242
+		include Plugin::$dirname.'/admin/meta-box-gateway-test.php';
243 243
 	}
244 244
 
245 245
 	/**
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 	 */
250 250
 	public function save_post( $post_id ) {
251 251
 		// Nonce.
252
-		if ( ! filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) {
252
+		if ( !filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) {
253 253
 			return $post_id;
254 254
 		}
255 255
 
@@ -269,9 +269,9 @@  discard block
 block discarded – undo
269 269
 		);
270 270
 
271 271
 		foreach ( $fields as $field ) {
272
-			if ( isset( $field['meta_key'], $field['filter'] ) ) {
273
-				$name   = $field['meta_key'];
274
-				$filter = $field['filter'];
272
+			if ( isset( $field[ 'meta_key' ], $field[ 'filter' ] ) ) {
273
+				$name   = $field[ 'meta_key' ];
274
+				$filter = $field[ 'filter' ];
275 275
 
276 276
 				$definition[ $name ] = $filter;
277 277
 			}
@@ -279,28 +279,28 @@  discard block
 block discarded – undo
279 279
 
280 280
 		$data = filter_input_array( INPUT_POST, $definition );
281 281
 
282
-		if ( ! empty( $data['_pronamic_gateway_id'] ) ) {
282
+		if ( !empty( $data[ '_pronamic_gateway_id' ] ) ) {
283 283
 			$integrations = $this->admin->plugin->gateway_integrations;
284 284
 
285
-			if ( isset( $integrations[ $data['_pronamic_gateway_id'] ] ) ) {
286
-				$integration = $integrations[ $data['_pronamic_gateway_id'] ];
285
+			if ( isset( $integrations[ $data[ '_pronamic_gateway_id' ] ] ) ) {
286
+				$integration = $integrations[ $data[ '_pronamic_gateway_id' ] ];
287 287
 			}
288 288
 
289 289
 			if ( $integration ) {
290 290
 				$settings = $integration->get_settings();
291 291
 
292 292
 				foreach ( $fields as $field ) {
293
-					if ( isset( $field['default'], $field['meta_key'], $data[ $field['meta_key'] ] ) ) {
293
+					if ( isset( $field[ 'default' ], $field[ 'meta_key' ], $data[ $field[ 'meta_key' ] ] ) ) {
294 294
 						// Remove default value if not applicable to the selected gateway.
295
-						if ( isset( $field['methods'] ) ) {
296
-							$clean_default = array_intersect( $settings, $field['methods'] );
295
+						if ( isset( $field[ 'methods' ] ) ) {
296
+							$clean_default = array_intersect( $settings, $field[ 'methods' ] );
297 297
 
298 298
 							if ( empty( $clean_default ) ) {
299
-								$meta_value = get_post_meta( $post_id, $field['meta_key'], true );
299
+								$meta_value = get_post_meta( $post_id, $field[ 'meta_key' ], true );
300 300
 
301 301
 								// Only remove value if not saved before.
302 302
 								if ( empty( $meta_value ) ) {
303
-									$data[ $field['meta_key'] ] = null;
303
+									$data[ $field[ 'meta_key' ] ] = null;
304 304
 
305 305
 									continue;
306 306
 								}
@@ -308,13 +308,13 @@  discard block
 block discarded – undo
308 308
 						}
309 309
 
310 310
 						// Set the default value if empty.
311
-						if ( empty( $data[ $field['meta_key'] ] ) ) {
312
-							$default = $field['default'];
311
+						if ( empty( $data[ $field[ 'meta_key' ] ] ) ) {
312
+							$default = $field[ 'default' ];
313 313
 
314
-							if ( is_array( $default ) && 2 === count( $default ) && Util::class_method_exists( $default[0], $default[1] ) ) {
315
-								$data[ $field['meta_key'] ] = call_user_func( $default, $field );
314
+							if ( is_array( $default ) && 2 === count( $default ) && Util::class_method_exists( $default[ 0 ], $default[ 1 ] ) ) {
315
+								$data[ $field[ 'meta_key' ] ] = call_user_func( $default, $field );
316 316
 							} else {
317
-								$data[ $field['meta_key'] ] = $default;
317
+								$data[ $field[ 'meta_key' ] ] = $default;
318 318
 							}
319 319
 						}
320 320
 					}
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 				// Filter data through gateway integration settings.
324 324
 				$settings_classes = $integration->get_settings_class();
325 325
 
326
-				if ( ! is_array( $settings_classes ) ) {
326
+				if ( !is_array( $settings_classes ) ) {
327 327
 					$settings_classes = array( $settings_classes );
328 328
 				}
329 329
 
@@ -339,8 +339,8 @@  discard block
 block discarded – undo
339 339
 		pronamic_pay_update_post_meta_data( $post_id, $data );
340 340
 
341 341
 		// Transient.
342
-		delete_transient( 'pronamic_pay_issuers_' . $post_id );
343
-		delete_transient( 'pronamic_gateway_payment_methods_' . $post_id );
342
+		delete_transient( 'pronamic_pay_issuers_'.$post_id );
343
+		delete_transient( 'pronamic_gateway_payment_methods_'.$post_id );
344 344
 
345 345
 		PaymentMethods::update_active_payment_methods();
346 346
 	}
@@ -364,14 +364,14 @@  discard block
 block discarded – undo
364 364
 			0  => '', // Unused. Messages start at index 1.
365 365
 			1  => __( 'Configuration updated.', 'pronamic_ideal' ),
366 366
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352799&filters[translation_id]=37947229
367
-			2  => $messages['post'][2],
367
+			2  => $messages[ 'post' ][ 2 ],
368 368
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352800&filters[translation_id]=37947870
369
-			3  => $messages['post'][3],
369
+			3  => $messages[ 'post' ][ 3 ],
370 370
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352798&filters[translation_id]=37947230
371 371
 			4  => __( 'Configuration updated.', 'pronamic_ideal' ),
372 372
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352801&filters[translation_id]=37947231
373 373
 			// translators: %s: date and time of the revision.
374
-			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.
374
+			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.
375 375
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352802&filters[translation_id]=37949178
376 376
 			6  => __( 'Configuration published.', 'pronamic_ideal' ),
377 377
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352803&filters[translation_id]=37947232
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352804&filters[translation_id]=37949303
380 380
 			8  => __( 'Configuration submitted.', 'pronamic_ideal' ),
381 381
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352805&filters[translation_id]=37949302
382
-			9  => sprintf( __( 'Configuration scheduled for: %s.', 'pronamic_ideal' ), '<strong>' . $scheduled_date . '</strong>' ),
382
+			9  => sprintf( __( 'Configuration scheduled for: %s.', 'pronamic_ideal' ), '<strong>'.$scheduled_date.'</strong>' ),
383 383
 			// @https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352806&filters[translation_id]=37949301
384 384
 			10 => __( 'Configuration draft updated.', 'pronamic_ideal' ),
385 385
 		);
Please login to merge, or discard this patch.
admin/meta-box-gateway-config-payment-methods.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@
 block discarded – undo
19 19
 	foreach ( $payment_methods as $payment_method => $details ) {
20 20
 		$class = $payment_method;
21 21
 
22
-		if ( $details['available'] ) {
22
+		if ( $details[ 'available' ] ) {
23 23
 			$class .= ' available';
24 24
 		}
25 25
 
26 26
 		printf(
27 27
 			'<li class="%1$s"><span class="pronamic-pay-icon pronamic-pay-icon-completed"></span> %2$s</li>',
28 28
 			esc_attr( $class ),
29
-			esc_html( $details['name'] )
29
+			esc_html( $details[ 'name' ] )
30 30
 		);
31 31
 	}
32 32
 
Please login to merge, or discard this patch.
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/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.
classes/Payments/PaymentsDataStoreCPT.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 		$post_status = $this->get_post_status( $payment->status, null );
114 114
 
115 115
 		if ( null !== $post_status ) {
116
-			$data['post_status'] = $post_status;
116
+			$data[ 'post_status' ] = $post_status;
117 117
 		}
118 118
 
119 119
 		wp_update_post( $data );
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
 
285 285
 			$can_redirect = false;
286 286
 
287
-			do_action( 'pronamic_payment_status_update_' . $payment->source . '_' . $old . '_to_' . $new, $payment, $can_redirect, $previous_status, $payment->status );
288
-			do_action( 'pronamic_payment_status_update_' . $payment->source, $payment, $can_redirect, $previous_status, $payment->status );
287
+			do_action( 'pronamic_payment_status_update_'.$payment->source.'_'.$old.'_to_'.$new, $payment, $can_redirect, $previous_status, $payment->status );
288
+			do_action( 'pronamic_payment_status_update_'.$payment->source, $payment, $can_redirect, $previous_status, $payment->status );
289 289
 			do_action( 'pronamic_payment_status_update', $payment, $can_redirect, $previous_status, $payment->status );
290 290
 		}
291 291
 	}
Please login to merge, or discard this patch.
classes/Subscriptions/SubscriptionsModule.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -82,15 +82,15 @@  discard block
 block discarded – undo
82 82
 	 * email notifications so users can cancel or renew their subscription.
83 83
 	 */
84 84
 	public function handle_subscription() {
85
-		if ( ! filter_has_var( INPUT_GET, 'subscription' ) ) {
85
+		if ( !filter_has_var( INPUT_GET, 'subscription' ) ) {
86 86
 			return;
87 87
 		}
88 88
 
89
-		if ( ! filter_has_var( INPUT_GET, 'action' ) ) {
89
+		if ( !filter_has_var( INPUT_GET, 'action' ) ) {
90 90
 			return;
91 91
 		}
92 92
 
93
-		if ( ! filter_has_var( INPUT_GET, 'key' ) ) {
93
+		if ( !filter_has_var( INPUT_GET, 'key' ) ) {
94 94
 			return;
95 95
 		}
96 96
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		$key = filter_input( INPUT_GET, 'key', FILTER_SANITIZE_STRING );
103 103
 
104 104
 		// Check if subscription is valid.
105
-		if ( ! $subscription ) {
105
+		if ( !$subscription ) {
106 106
 			return;
107 107
 		}
108 108
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 				if ( Statuses::SUCCESS !== $subscription->get_status() ) {
132 132
 					$payment = $this->start_recurring( $subscription, $gateway, true );
133 133
 
134
-					if ( ! $gateway->has_error() ) {
134
+					if ( !$gateway->has_error() ) {
135 135
 						// Redirect.
136 136
 						$gateway->redirect( $payment );
137 137
 					}
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 		$payment->start_date       = $start_date;
201 201
 		$payment->end_date         = $end_date;
202 202
 		$payment->recurring_type   = 'recurring';
203
-		$payment->recurring        = ! $renewal;
203
+		$payment->recurring        = !$renewal;
204 204
 
205 205
 		// Start payment.
206 206
 		$payment = Plugin::start_payment( $payment, $gateway );
@@ -243,11 +243,11 @@  discard block
 block discarded – undo
243 243
 	 * @return array
244 244
 	 */
245 245
 	public function exclude_subscription_comment_notes( $clauses, $query ) {
246
-		$type = $query->query_vars['type'];
246
+		$type = $query->query_vars[ 'type' ];
247 247
 
248 248
 		// Ignore subscription notes comments if it's not specifically requested.
249 249
 		if ( 'subscription_note' !== $type ) {
250
-			$clauses['where'] .= " AND comment_type != 'subscription_note'";
250
+			$clauses[ 'where' ] .= " AND comment_type != 'subscription_note'";
251 251
 		}
252 252
 
253 253
 		return $clauses;
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 		// Check if there is already subscription attached to the payment.
274 274
 		$subscription_id = $payment->get_subscription_id();
275 275
 
276
-		if ( ! empty( $subscription_id ) ) {
276
+		if ( !empty( $subscription_id ) ) {
277 277
 			// Subscription already created.
278 278
 			return;
279 279
 		}
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 				delete_post_meta( $post->ID, '_pronamic_subscription_renewal_sent_1week' );
478 478
 			}
479 479
 
480
-			do_action( 'pronamic_subscription_renewal_notice_' . $subscription->get_source(), $subscription );
480
+			do_action( 'pronamic_subscription_renewal_notice_'.$subscription->get_source(), $subscription );
481 481
 
482 482
 			update_post_meta( $post->ID, '_pronamic_subscription_renewal_sent_1week', $start_date->format( DateTime::MYSQL ) );
483 483
 		}
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 		}
523 523
 
524 524
 		// The status of canceled or completed subscriptions will not be changed automatically.
525
-		if ( ! in_array( $status_before, array( Statuses::CANCELLED, Statuses::COMPLETED ), true ) ) {
525
+		if ( !in_array( $status_before, array( Statuses::CANCELLED, Statuses::COMPLETED ), true ) ) {
526 526
 			$subscription->set_status( $status_update );
527 527
 		}
528 528
 
Please login to merge, or discard this patch.
classes/Subscriptions/SubscriptionsDataStoreCPT.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 		$post_status = $this->get_post_status( $subscription->get_status(), null );
99 99
 
100 100
 		if ( null !== $post_status ) {
101
-			$data['post_status'] = $post_status;
101
+			$data[ 'post_status' ] = $post_status;
102 102
 		}
103 103
 
104 104
 		wp_update_post( $data );
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
 
293 293
 			$can_redirect = false;
294 294
 
295
-			do_action( 'pronamic_subscription_status_update_' . $subscription->source . '_' . $old . '_to_' . $new, $subscription, $can_redirect, $previous_status, $subscription->status );
296
-			do_action( 'pronamic_subscription_status_update_' . $subscription->source, $subscription, $can_redirect, $previous_status, $subscription->status );
295
+			do_action( 'pronamic_subscription_status_update_'.$subscription->source.'_'.$old.'_to_'.$new, $subscription, $can_redirect, $previous_status, $subscription->status );
296
+			do_action( 'pronamic_subscription_status_update_'.$subscription->source, $subscription, $can_redirect, $previous_status, $subscription->status );
297 297
 			do_action( 'pronamic_subscription_status_update', $subscription, $can_redirect, $previous_status, $subscription->status );
298 298
 		}
299 299
 	}
Please login to merge, or discard this patch.