Passed
Push — develop ( ff75e1...e7463e )
by Remco
04:14
created
classes/Admin/PaymentPostType.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 		$screen = get_current_screen();
77 77
 
78 78
 		if ( self::POST_TYPE === $screen->post_type ) {
79
-			if ( ! isset( $vars['post_status'] ) ) {
80
-				$vars['post_status'] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_payment_states() );
79
+			if ( ! isset( $vars[ 'post_status' ] ) ) {
80
+				$vars[ 'post_status' ] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_payment_states() );
81 81
 
82
-				$vars['post_status'][] = 'publish';
82
+				$vars[ 'post_status' ][ ] = 'publish';
83 83
 			}
84 84
 		}
85 85
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
 			\Pronamic\WordPress\Pay\Plugin::update_payment( $payment, false );
111 111
 
112
-			$this->admin_notices[] = array(
112
+			$this->admin_notices[ ] = array(
113 113
 				'type'    => 'info',
114 114
 				'message' => __( 'Payment status updated.', 'pronamic_ideal' ),
115 115
 			);
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 		foreach ( $this->admin_notices as $notice ) {
124 124
 			printf(
125 125
 				'<div class="notice notice-%1$s"><p>%2$s</p></div>',
126
-				esc_attr( $notice['type'] ),
127
-				esc_html( $notice['message'] )
126
+				esc_attr( $notice[ 'type' ] ),
127
+				esc_html( $notice[ 'message' ] )
128 128
 			);
129 129
 		}
130 130
 	}
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
 	 * @return array
180 180
 	 */
181 181
 	public function default_hidden_columns( $hidden ) {
182
-		$hidden[] = 'pronamic_payment_gateway';
183
-		$hidden[] = 'pronamic_payment_description';
182
+		$hidden[ ] = 'pronamic_payment_gateway';
183
+		$hidden[ ] = 'pronamic_payment_description';
184 184
 
185 185
 		return $hidden;
186 186
 	}
@@ -192,9 +192,9 @@  discard block
 block discarded – undo
192 192
 	 * @return array
193 193
 	 */
194 194
 	public function sortable_columns( $sortable_columns ) {
195
-		$sortable_columns['pronamic_payment_title']  = 'ID';
196
-		$sortable_columns['pronamic_payment_amount'] = 'pronamic_payment_amount';
197
-		$sortable_columns['pronamic_payment_date']   = 'date';
195
+		$sortable_columns[ 'pronamic_payment_title' ]  = 'ID';
196
+		$sortable_columns[ 'pronamic_payment_amount' ] = 'pronamic_payment_amount';
197
+		$sortable_columns[ 'pronamic_payment_date' ]   = 'date';
198 198
 
199 199
 		return $sortable_columns;
200 200
 	}
@@ -532,14 +532,14 @@  discard block
 block discarded – undo
532 532
 			0  => '', // Unused. Messages start at index 1.
533 533
 			1  => __( 'Payment updated.', 'pronamic_ideal' ),
534 534
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352799&filters[translation_id]=37947229.
535
-			2  => $messages['post'][2],
535
+			2  => $messages[ 'post' ][ 2 ],
536 536
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352800&filters[translation_id]=37947870.
537
-			3  => $messages['post'][3],
537
+			3  => $messages[ 'post' ][ 3 ],
538 538
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352798&filters[translation_id]=37947230.
539 539
 			4  => __( 'Payment updated.', 'pronamic_ideal' ),
540 540
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352801&filters[translation_id]=37947231.
541 541
 			// translators: %s: date and time of the revision
542
-			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.
542
+			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.
543 543
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352802&filters[translation_id]=37949178.
544 544
 			6  => __( 'Payment published.', 'pronamic_ideal' ),
545 545
 			// @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352803&filters[translation_id]=37947232.
Please login to merge, or discard this patch.
classes/Admin/AdminReports.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@
 block discarded – undo
347 347
 				$value = (float) $data[ $key ]->value;
348 348
 			}
349 349
 
350
-			$report[] = array(
350
+			$report[ ] = array(
351 351
 				// Flot requires milliseconds so multiply with 1000.
352 352
 				$date->getTimestamp() * 1000,
353 353
 				$value,
Please login to merge, or discard this patch.
classes/Admin/PaymentBulkActions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public function bulk_actions( $bulk_actions ) {
63 63
 		// Don't allow edit in bulk.
64
-		unset( $bulk_actions['edit'] );
64
+		unset( $bulk_actions[ 'edit' ] );
65 65
 
66 66
 		// Bulk check payment status.
67
-		$bulk_actions['pronamic_payment_check_status'] = __( 'Check Payment Status', 'pronamic_ideal' );
67
+		$bulk_actions[ 'pronamic_payment_check_status' ] = __( 'Check Payment Status', 'pronamic_ideal' );
68 68
 
69 69
 		return $bulk_actions;
70 70
 	}
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 				$gateways[ $config_id ] = \Pronamic\WordPress\Pay\Plugin::get_gateway( $config_id );
107 107
 
108 108
 				if ( $gateways[ $config_id ] && ! $gateways[ $config_id ]->supports( 'payment_status_request' ) ) {
109
-					$unsupported_gateways[] = $config_id;
109
+					$unsupported_gateways[ ] = $config_id;
110 110
 				}
111 111
 			}
112 112
 
Please login to merge, or discard this patch.
classes/Admin/AdminSettings.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 * @param array $args Arguments.
168 168
 	 */
169 169
 	public function settings_section( $args ) {
170
-		switch ( $args['id'] ) {
170
+		switch ( $args[ 'id' ] ) {
171 171
 			case 'pronamic_pay_pages':
172 172
 				echo '<p>';
173 173
 				esc_html_e( 'The page an user will get redirected to after payment, based on the payment status.', 'pronamic_ideal' );
@@ -212,14 +212,14 @@  discard block
 block discarded – undo
212 212
 
213 213
 		$args = wp_parse_args( $args, $defaults );
214 214
 
215
-		$name  = $args['label_for'];
215
+		$name  = $args[ 'label_for' ];
216 216
 		$value = get_option( $name );
217 217
 
218 218
 		$atts = array(
219 219
 			'name'  => $name,
220 220
 			'id'    => $name,
221
-			'type'  => $args['type'],
222
-			'class' => $args['classes'],
221
+			'type'  => $args[ 'type' ],
222
+			'class' => $args[ 'classes' ],
223 223
 			'value' => $value,
224 224
 		);
225 225
 
@@ -230,10 +230,10 @@  discard block
 block discarded – undo
230 230
 			// @codingStandardsIgnoreEn
231 231
 		);
232 232
 
233
-		if ( ! empty( $args['description'] ) ) {
233
+		if ( ! empty( $args[ 'description' ] ) ) {
234 234
 			printf(
235 235
 				'<p class="description">%s</p>',
236
-				esc_html( $args['description'] )
236
+				esc_html( $args[ 'description' ] )
237 237
 			);
238 238
 		}
239 239
 	}
@@ -246,10 +246,10 @@  discard block
 block discarded – undo
246 246
 	 * @param array $args Arguments.
247 247
 	 */
248 248
 	public function input_checkbox( $args ) {
249
-		$id     = $args['label_for'];
250
-		$name   = $args['label_for'];
249
+		$id     = $args[ 'label_for' ];
250
+		$name   = $args[ 'label_for' ];
251 251
 		$value  = get_option( $name );
252
-		$legend = $args['legend'];
252
+		$legend = $args[ 'legend' ];
253 253
 
254 254
 		echo '<fieldset>';
255 255
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 			checked( $value, 1, false )
271 271
 		);
272 272
 
273
-		echo esc_html( $args['description'] );
273
+		echo esc_html( $args[ 'description' ] );
274 274
 
275 275
 		echo '</label>';
276 276
 
@@ -300,13 +300,13 @@  discard block
 block discarded – undo
300 300
 	 * @param array $args Arguments.
301 301
 	 */
302 302
 	public function input_page( $args ) {
303
-		$name = $args['label_for'];
303
+		$name = $args[ 'label_for' ];
304 304
 
305 305
 		wp_dropdown_pages( array(
306 306
 			'name'             => esc_attr( $name ),
307
-			'post_type'        => esc_attr( isset( $args['post_type'] ) ? $args['post_type'] : 'page' ),
307
+			'post_type'        => esc_attr( isset( $args[ 'post_type' ] ) ? $args[ 'post_type' ] : 'page' ),
308 308
 			'selected'         => esc_attr( get_option( $name, '' ) ),
309
-			'show_option_none' => esc_attr( isset( $args['show_option_none'] ) ? $args['show_option_none'] : __( '— Select a page —', 'pronamic_ideal' ) ),
309
+			'show_option_none' => esc_attr( isset( $args[ 'show_option_none' ] ) ? $args[ 'show_option_none' ] : __( '— Select a page —', 'pronamic_ideal' ) ),
310 310
 			'class'            => 'regular-text',
311 311
 		) );
312 312
 	}
Please login to merge, or discard this patch.
classes/Forms/FormShortcode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 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
 	}
Please login to merge, or discard this patch.
classes/Forms/FormProcessor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,14 +132,14 @@
 block discarded – undo
132 132
 		$first_name = filter_input( INPUT_POST, 'pronamic_pay_first_name', FILTER_SANITIZE_STRING );
133 133
 
134 134
 		if ( empty( $first_name ) ) {
135
-			$pronamic_pay_errors['first_name'] = __( 'Please enter your first name', 'pronamic_ideal' );
135
+			$pronamic_pay_errors[ 'first_name' ] = __( 'Please enter your first name', 'pronamic_ideal' );
136 136
 		}
137 137
 
138 138
 		// E-mail.
139 139
 		$email = filter_input( INPUT_POST, 'pronamic_pay_email', FILTER_VALIDATE_EMAIL );
140 140
 
141 141
 		if ( empty( $email ) ) {
142
-			$pronamic_pay_errors['email'] = __( 'Please enter a valid email address', 'pronamic_ideal' );
142
+			$pronamic_pay_errors[ 'email' ] = __( 'Please enter a valid email address', 'pronamic_ideal' );
143 143
 		}
144 144
 
145 145
 		return empty( $pronamic_pay_errors );
Please login to merge, or discard this patch.
classes/Forms/FormPostType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -307,15 +307,15 @@
 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/Settings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		register_setting(
120 120
 			'pronamic_pay', 'pronamic_pay_thousands_sep', array(
121 121
 				'type'              => 'string',
122
-				'default'           => $wp_locale->number_format['thousands_sep'],
122
+				'default'           => $wp_locale->number_format[ 'thousands_sep' ],
123 123
 				'sanitize_callback' => null,
124 124
 			)
125 125
 		);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		register_setting(
133 133
 			'pronamic_pay', 'pronamic_pay_decimal_sep', array(
134 134
 				'type'              => 'string',
135
-				'default'           => $wp_locale->number_format['decimal_point'],
135
+				'default'           => $wp_locale->number_format[ 'decimal_point' ],
136 136
 				'sanitize_callback' => null,
137 137
 			)
138 138
 		);
Please login to merge, or discard this patch.
classes/Payments/Items.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 	 * @param Item $item The item to add.
50 50
 	 */
51 51
 	public function addItem( Item $item ) {
52
-		$this->items[] = $item;
52
+		$this->items[ ] = $item;
53 53
 	}
54 54
 
55 55
 	/**
Please login to merge, or discard this patch.