Completed
Push — develop ( f29211...ed262e )
by Remco
10:29 queued 57s
created
admin/meta-box-notes.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
8 8
  * @package   Pronamic\WordPress\Pay
9 9
  */
10 10
 
11
-if ( ! isset( $notes ) ) {
11
+if ( !isset( $notes ) ) {
12 12
 	return;
13 13
 }
14 14
 
15
-if ( ! is_array( $notes ) ) {
15
+if ( !is_array( $notes ) ) {
16 16
 	return;
17 17
 }
18 18
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,12 +20,15 @@
 block discarded – undo
20 20
 
21 21
 	<?php esc_html_e( 'No notes found.', 'pronamic_ideal' ); ?>
22 22
 
23
-<?php else : ?>
23
+<?php else {
24
+	: ?>
24 25
 
25 26
 	<table class="pronamic-pay-table widefat">
26 27
 		<thead>
27 28
 			<tr>
28
-				<th scope="col"><?php esc_html_e( 'Date', 'pronamic_ideal' ); ?></th>
29
+				<th scope="col"><?php esc_html_e( 'Date', 'pronamic_ideal' );
30
+}
31
+?></th>
29 32
 				<th scope="col"><?php esc_html_e( 'Note', 'pronamic_ideal' ); ?></th>
30 33
 			</tr>
31 34
 		</thead>
Please login to merge, or discard this patch.
classes/Util.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	public static function remote_get_body( $url, $required_response_code = 200, array $args = array() ) {
36 36
 		$result = wp_remote_request( $url, $args );
37 37
 
38
-		if ( ! is_array( $result ) ) {
38
+		if ( !is_array( $result ) ) {
39 39
 			return $result;
40 40
 		}
41 41
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		// @see https://en.wikipedia.org/wiki/Non-breaking_space#Keyboard_entry_methods
191 191
 		$non_breaking_space = ' ';
192 192
 
193
-		return '' . $currency_symbol . $non_breaking_space . number_format_i18n( $float, 2 );
193
+		return ''.$currency_symbol.$non_breaking_space.number_format_i18n( $float, 2 );
194 194
 	}
195 195
 
196 196
 	/**
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	 * @return string
269 269
 	 */
270 270
 	public static function build_url( $url, array $parameters ) {
271
-		return $url . '?' . _http_build_query( $parameters, null, '&' );
271
+		return $url.'?'._http_build_query( $parameters, null, '&' );
272 272
 	}
273 273
 
274 274
 	/**
@@ -320,14 +320,14 @@  discard block
 block discarded – undo
320 320
 
321 321
 		if ( is_array( $groups ) ) {
322 322
 			foreach ( $groups as $group ) {
323
-				$optgroup = isset( $group['name'] ) && ! empty( $group['name'] );
323
+				$optgroup = isset( $group[ 'name' ] ) && !empty( $group[ 'name' ] );
324 324
 
325 325
 				if ( $optgroup ) {
326
-					$html .= '<optgroup label="' . $group['name'] . '">';
326
+					$html .= '<optgroup label="'.$group[ 'name' ].'">';
327 327
 				}
328 328
 
329
-				foreach ( $group['options'] as $value => $label ) {
330
-					$html .= '<option value="' . $value . '" ' . selected( $selected_value, $value, false ) . '>' . $label . '</option>';
329
+				foreach ( $group[ 'options' ] as $value => $label ) {
330
+					$html .= '<option value="'.$value.'" '.selected( $selected_value, $value, false ).'>'.$label.'</option>';
331 331
 				}
332 332
 
333 333
 				if ( $optgroup ) {
Please login to merge, or discard this patch.
classes/Plugin.php 1 patch
Spacing   +20 added lines, -20 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
 
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
 			$subscription = $payment->get_subscription();
921 921
 
922 922
 			if ( $subscription ) {
923
-				if ( ! $payment->get_recurring() ) {
923
+				if ( !$payment->get_recurring() ) {
924 924
 					// First payment.
925 925
 					// Cancel subscription to prevent unwanted recurring payments in the future,
926 926
 					// when a valid customer ID might be set for the user.
Please login to merge, or discard this patch.
classes/GatewayIntegrations.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 			'test' => 'https://abnamro-test.ideal-payment.de/',
77 77
 			'live' => 'https://abnamro.ideal-payment.de/',
78 78
 		);
79
-		$abn_amro_ideal_zelfbouw_v3->provider      = 'abnamro';
79
+		$abn_amro_ideal_zelfbouw_v3->provider = 'abnamro';
80 80
 
81 81
 		// Deutsche Bank - iDEAL via Ogone.
82 82
 		$deutsche_bank_ideal_ogone = new Gateways\Ingenico\OrderStandardEasy\Integration();
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 			'test' => 'https://myideal.test.db.com/',
95 95
 			'live' => 'https://myideal.db.com/',
96 96
 		);
97
-		$deutsche_bank_ideal_expert_v3->provider      = 'deutschebank';
97
+		$deutsche_bank_ideal_expert_v3->provider = 'deutschebank';
98 98
 
99 99
 		// Fibonacci ORANGE.
100 100
 		$fibonacci_orange = new Gateways\Icepay\Integration();
Please login to merge, or discard this patch.
tests/Payments/PaymentTest.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	public function test_construct() {
28 28
 		$payment = new Payment();
29 29
 
30
-		$this->assertInstanceOf( __NAMESPACE__ . '\Payment', $payment );
30
+		$this->assertInstanceOf( __NAMESPACE__.'\Payment', $payment );
31 31
 	}
32 32
 
33 33
 	/**
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 
46 46
 	public function get_and_set_provider() {
47 47
 		return array(
48
-			array( 'set_id',             'get_id',             uniqid()    ),
49
-			array( 'set_transaction_id', 'get_transaction_id', uniqid()    ),
50
-			array( 'set_status',         'get_status',         'completed' ),
48
+			array( 'set_id', 'get_id', uniqid() ),
49
+			array( 'set_transaction_id', 'get_transaction_id', uniqid() ),
50
+			array( 'set_status', 'get_status', 'completed' ),
51 51
 		);
52 52
 	}
53 53
 
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
 
67 67
 	public function set_provider() {
68 68
 		return array(
69
-			array( 'set_consumer_name',           'consumer_name',           'John Doe' ),
69
+			array( 'set_consumer_name', 'consumer_name', 'John Doe' ),
70 70
 			array( 'set_consumer_account_number', 'consumer_account_number', '1086.34.779' ),
71
-			array( 'set_consumer_iban',           'consumer_iban',           'NL56 RABO 0108 6347 79' ),
72
-			array( 'set_consumer_bic',            'consumer_bic',            'RABONL2U' ),
73
-			array( 'set_consumer_city',           'consumer_city',           'Drachten' ),
71
+			array( 'set_consumer_iban', 'consumer_iban', 'NL56 RABO 0108 6347 79' ),
72
+			array( 'set_consumer_bic', 'consumer_bic', 'RABONL2U' ),
73
+			array( 'set_consumer_city', 'consumer_city', 'Drachten' ),
74 74
 		);
75 75
 	}
76 76
 
@@ -89,25 +89,25 @@  discard block
 block discarded – undo
89 89
 
90 90
 	public function get_provider() {
91 91
 		return array(
92
-			array( 'order_id',            'get_order_id',            1234 ),
93
-			array( 'amount',              'get_amount',              89.95 ),
94
-			array( 'currency',            'get_currency',            'EUR' ),
95
-			array( 'method',              'get_method',              'ideal' ),
96
-			array( 'issuer',              'get_issuer',              'ideal_KNABNL2H' ),
97
-			array( 'language',            'get_language',            'nl' ),
98
-			array( 'locale',              'get_locale',              'nl_NL' ),
99
-			array( 'description',         'get_description',         'Lorem ipsum dolor sit amet, consectetur.' ),
100
-			array( 'email',               'get_email',               '[email protected]' ),
101
-			array( 'first_name',          'get_first_name',          'John' ),
102
-			array( 'last_name',           'get_last_name',           'Doe' ),
103
-			array( 'customer_name',       'get_customer_name',       'John Doe' ),
104
-			array( 'address',             'get_address',             'Burgemeester Wuiteweg 39b' ),
105
-			array( 'city',                'get_city',                'Drachten' ),
106
-			array( 'zip',                 'get_zip',                 '9203 KA' ),
107
-			array( 'country',             'get_country',             'NL' ),
108
-			array( 'telephone_number',    'get_telephone_number',    '1234567890' ),
92
+			array( 'order_id', 'get_order_id', 1234 ),
93
+			array( 'amount', 'get_amount', 89.95 ),
94
+			array( 'currency', 'get_currency', 'EUR' ),
95
+			array( 'method', 'get_method', 'ideal' ),
96
+			array( 'issuer', 'get_issuer', 'ideal_KNABNL2H' ),
97
+			array( 'language', 'get_language', 'nl' ),
98
+			array( 'locale', 'get_locale', 'nl_NL' ),
99
+			array( 'description', 'get_description', 'Lorem ipsum dolor sit amet, consectetur.' ),
100
+			array( 'email', 'get_email', '[email protected]' ),
101
+			array( 'first_name', 'get_first_name', 'John' ),
102
+			array( 'last_name', 'get_last_name', 'Doe' ),
103
+			array( 'customer_name', 'get_customer_name', 'John Doe' ),
104
+			array( 'address', 'get_address', 'Burgemeester Wuiteweg 39b' ),
105
+			array( 'city', 'get_city', 'Drachten' ),
106
+			array( 'zip', 'get_zip', '9203 KA' ),
107
+			array( 'country', 'get_country', 'NL' ),
108
+			array( 'telephone_number', 'get_telephone_number', '1234567890' ),
109 109
 			array( 'analytics_client_id', 'get_analytics_client_id', 'GA1.2.1234567890.1234567890' ),
110
-			array( 'entrance_code',       'get_entrance_code',       uniqid() ),
110
+			array( 'entrance_code', 'get_entrance_code', uniqid() ),
111 111
 		);
112 112
 	}
113 113
 
Please login to merge, or discard this patch.
classes/DateTimeZone.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 	public static function get_default() {
31 31
 		$timezone_string = get_option( 'timezone_string' );
32 32
 
33
-		if ( ! empty( $timezone_string ) ) {
33
+		if ( !empty( $timezone_string ) ) {
34 34
 			return new DateTimeZone( $timezone_string );
35 35
 		}
36 36
 
Please login to merge, or discard this patch.
tests/Subscriptions/SubscriptionTest.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	public function test_construct() {
26 26
 		$subscription = new Subscription();
27 27
 
28
-		$this->assertInstanceOf( __NAMESPACE__ . '\Subscription', $subscription );
28
+		$this->assertInstanceOf( __NAMESPACE__.'\Subscription', $subscription );
29 29
 	}
30 30
 
31 31
 	/**
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 
44 44
 	public function get_and_set_provider() {
45 45
 		return array(
46
-			array( 'set_id',             'get_id',             uniqid()    ),
47
-			array( 'set_status',         'get_status',         'completed' ),
48
-			array( 'set_transaction_id', 'get_transaction_id', uniqid()    ),
46
+			array( 'set_id', 'get_id', uniqid() ),
47
+			array( 'set_status', 'get_status', 'completed' ),
48
+			array( 'set_transaction_id', 'get_transaction_id', uniqid() ),
49 49
 		);
50 50
 	}
51 51
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		return array(
67 67
 			array( 'set_consumer_name', 'consumer_name', 'John Doe' ),
68 68
 			array( 'set_consumer_iban', 'consumer_iban', 'NL56 RABO 0108 6347 79' ),
69
-			array( 'set_consumer_bic',  'consumer_bic',  'RABONL2U' ),
69
+			array( 'set_consumer_bic', 'consumer_bic', 'RABONL2U' ),
70 70
 		);
71 71
 	}
72 72
 
@@ -85,15 +85,15 @@  discard block
 block discarded – undo
85 85
 
86 86
 	public function get_provider() {
87 87
 		return array(
88
-			array( 'key',                 'get_key',             uniqid() ),
89
-			array( 'source',              'get_source',          'woocommerce' ),
90
-			array( 'source_id',           'get_source_id',       '1234' ),
91
-			array( 'frequency',           'get_frequency',       'daily' ),
92
-			array( 'interval',            'get_interval',        '1' ),
93
-			array( 'interval_period',     'get_interval_period', 'Y' ),
94
-			array( 'description',         'get_description',     'Lorem ipsum dolor sit amet, consectetur.' ),
95
-			array( 'currency',            'get_currency',        'EUR' ),
96
-			array( 'amount',              'get_amount',          89.95 ),
88
+			array( 'key', 'get_key', uniqid() ),
89
+			array( 'source', 'get_source', 'woocommerce' ),
90
+			array( 'source_id', 'get_source_id', '1234' ),
91
+			array( 'frequency', 'get_frequency', 'daily' ),
92
+			array( 'interval', 'get_interval', '1' ),
93
+			array( 'interval_period', 'get_interval_period', 'Y' ),
94
+			array( 'description', 'get_description', 'Lorem ipsum dolor sit amet, consectetur.' ),
95
+			array( 'currency', 'get_currency', 'EUR' ),
96
+			array( 'amount', 'get_amount', 89.95 ),
97 97
 		);
98 98
 	}
99 99
 
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.4.0',
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/PaymentPostType.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 	public function __construct() {
41 41
 		add_filter( 'request', array( $this, 'request' ) );
42 42
 
43
-		add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'columns' ) );
44
-		add_filter( 'manage_edit-' . self::POST_TYPE . '_sortable_columns', array( $this, 'sortable_columns' ) );
43
+		add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'columns' ) );
44
+		add_filter( 'manage_edit-'.self::POST_TYPE.'_sortable_columns', array( $this, 'sortable_columns' ) );
45 45
 
46
-		add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
46
+		add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
47 47
 
48 48
 		add_action( 'load-post.php', array( $this, 'maybe_check_status' ) );
49 49
 
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 		$screen = get_current_screen();
79 79
 
80 80
 		if ( self::POST_TYPE === $screen->post_type ) {
81
-			if ( ! isset( $vars['post_status'] ) ) {
82
-				$vars['post_status'] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_payment_states() );
81
+			if ( !isset( $vars[ 'post_status' ] ) ) {
82
+				$vars[ 'post_status' ] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_payment_states() );
83 83
 
84
-				$vars['post_status'][] = 'publish';
84
+				$vars[ 'post_status' ][ ] = 'publish';
85 85
 			}
86 86
 		}
87 87
 
@@ -93,25 +93,25 @@  discard block
 block discarded – undo
93 93
 	 */
94 94
 	public function maybe_check_status() {
95 95
 		// Current user.
96
-		if ( ! current_user_can( 'edit_payments' ) ) {
96
+		if ( !current_user_can( 'edit_payments' ) ) {
97 97
 			return;
98 98
 		}
99 99
 
100 100
 		// Screen.
101 101
 		$screen = get_current_screen();
102 102
 
103
-		if ( ! ( 'post' === $screen->base && 'pronamic_payment' === $screen->post_type ) ) {
103
+		if ( !( 'post' === $screen->base && 'pronamic_payment' === $screen->post_type ) ) {
104 104
 			return;
105 105
 		}
106 106
 
107 107
 		$post_id = filter_input( INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT );
108 108
 
109
-		if ( filter_has_var( INPUT_GET, 'pronamic_pay_check_status' ) && check_admin_referer( 'pronamic_payment_check_status_' . $post_id ) ) {
109
+		if ( filter_has_var( INPUT_GET, 'pronamic_pay_check_status' ) && check_admin_referer( 'pronamic_payment_check_status_'.$post_id ) ) {
110 110
 			$payment = get_pronamic_payment( $post_id );
111 111
 
112 112
 			\Pronamic\WordPress\Pay\Plugin::update_payment( $payment, false );
113 113
 
114
-			$this->admin_notices[] = array(
114
+			$this->admin_notices[ ] = array(
115 115
 				'type'    => 'info',
116 116
 				'message' => __( 'Payment status updated.', 'pronamic_ideal' ),
117 117
 			);
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 		foreach ( $this->admin_notices as $notice ) {
126 126
 			printf(
127 127
 				'<div class="notice notice-%1$s"><p>%2$s</p></div>',
128
-				esc_attr( $notice['type'] ),
129
-				esc_html( $notice['message'] )
128
+				esc_attr( $notice[ 'type' ] ),
129
+				esc_html( $notice[ 'message' ] )
130 130
 			);
131 131
 		}
132 132
 	}
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 	 * @return array
182 182
 	 */
183 183
 	public function default_hidden_columns( $hidden ) {
184
-		$hidden[] = 'pronamic_payment_gateway';
185
-		$hidden[] = 'pronamic_payment_description';
184
+		$hidden[ ] = 'pronamic_payment_gateway';
185
+		$hidden[ ] = 'pronamic_payment_description';
186 186
 
187 187
 		return $hidden;
188 188
 	}
@@ -194,9 +194,9 @@  discard block
 block discarded – undo
194 194
 	 * @return array
195 195
 	 */
196 196
 	public function sortable_columns( $sortable_columns ) {
197
-		$sortable_columns['pronamic_payment_title']  = 'ID';
198
-		$sortable_columns['pronamic_payment_amount'] = 'pronamic_payment_amount';
199
-		$sortable_columns['pronamic_payment_date']   = 'date';
197
+		$sortable_columns[ 'pronamic_payment_title' ]  = 'ID';
198
+		$sortable_columns[ 'pronamic_payment_amount' ] = 'pronamic_payment_amount';
199
+		$sortable_columns[ 'pronamic_payment_date' ]   = 'date';
200 200
 
201 201
 		return $sortable_columns;
202 202
 	}
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
 					$recurring = get_post_meta( $post_id, '_pronamic_payment_recurring', true );
245 245
 
246
-					if ( ! $recurring ) {
246
+					if ( !$recurring ) {
247 247
 						$label = __( 'First of recurring payment', 'pronamic_ideal' );
248 248
 						$class = ' pronamic-pay-icon-recurring-first';
249 249
 					}
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 				$source_id          = $payment->get_source_id();
263 263
 				$source_description = $payment->get_source_description();
264 264
 
265
-				$source_id_text = '#' . $source_id;
265
+				$source_id_text = '#'.$source_id;
266 266
 
267 267
 				$source_link = $payment->get_source_link();
268 268
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 			case 'pronamic_payment_gateway':
299 299
 				$config_id = get_post_meta( $post_id, '_pronamic_payment_config_id', true );
300 300
 
301
-				if ( ! empty( $config_id ) ) {
301
+				if ( !empty( $config_id ) ) {
302 302
 					echo get_the_title( $config_id );
303 303
 				} else {
304 304
 					echo '—';
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 	 * @param WP_Post $post The object for the current post/page.
412 412
 	 */
413 413
 	public function meta_box_info( $post ) {
414
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-payment-info.php';
414
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-payment-info.php';
415 415
 	}
416 416
 
417 417
 	/**
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 			)
428 428
 		);
429 429
 
430
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-notes.php';
430
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-notes.php';
431 431
 	}
432 432
 
433 433
 	/**
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 	 * @param WP_Post $post The object for the current post/page.
437 437
 	 */
438 438
 	public function meta_box_subscription( $post ) {
439
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-payment-subscription.php';
439
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-payment-subscription.php';
440 440
 	}
441 441
 
442 442
 	/**
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 	public function meta_box_update( $post ) {
448 448
 		wp_nonce_field( 'pronamic_payment_update', 'pronamic_payment_update_nonce' );
449 449
 
450
-		include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-payment-update.php';
450
+		include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-payment-update.php';
451 451
 	}
452 452
 
453 453
 	/**
@@ -535,14 +535,14 @@  discard block
 block discarded – undo
535 535
 			0  => '', // Unused. Messages start at index 1.
536 536
 			1  => __( 'Payment updated.', 'pronamic_ideal' ),
537 537
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352799&filters[translation_id]=37947229.
538
-			2  => $messages['post'][2],
538
+			2  => $messages[ 'post' ][ 2 ],
539 539
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352800&filters[translation_id]=37947870.
540
-			3  => $messages['post'][3],
540
+			3  => $messages[ 'post' ][ 3 ],
541 541
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352798&filters[translation_id]=37947230.
542 542
 			4  => __( 'Payment updated.', 'pronamic_ideal' ),
543 543
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352801&filters[translation_id]=37947231.
544 544
 			// translators: %s: date and time of the revision
545
-			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.
545
+			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.
546 546
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352802&filters[translation_id]=37949178.
547 547
 			6  => __( 'Payment published.', 'pronamic_ideal' ),
548 548
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352803&filters[translation_id]=37947232.
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352804&filters[translation_id]=37949303.
551 551
 			8  => __( 'Payment submitted.', 'pronamic_ideal' ),
552 552
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352805&filters[translation_id]=37949302.
553
-			9  => sprintf( __( 'Payment scheduled for: %s.', 'pronamic_ideal' ), '<strong>' . $scheduled_date . '</strong>' ),
553
+			9  => sprintf( __( 'Payment scheduled for: %s.', 'pronamic_ideal' ), '<strong>'.$scheduled_date.'</strong>' ),
554 554
 			// @https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352806&filters[translation_id]=37949301.
555 555
 			10 => __( 'Payment draft updated.', 'pronamic_ideal' ),
556 556
 		);
Please login to merge, or discard this patch.