Passed
Push — develop ( 246341...deb241 )
by Remco
04:52
created
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', $this->plugin->get_file() ),
379
+				plugins_url( 'assets/tippy.js/tippy.all'.$min.'.js', $this->plugin->get_file() ),
380 380
 				array(),
381 381
 				'2.5.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', $this->plugin->get_file() ),
395
+				plugins_url( 'css/admin'.$min.'.css', $this->plugin->get_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', $this->plugin->get_file() ),
402
+				plugins_url( 'js/admin'.$min.'.js', $this->plugin->get_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( $this->plugin->get_file() ) . 'admin/page-' . $name . '.php';
566
+		$file = plugin_dir_path( $this->plugin->get_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/AdminAboutPage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 				array( $this, 'page_about' )
69 69
 			);
70 70
 
71
-			add_action( 'admin_print_styles-' . $hook_suffix, array( $this, 'admin_css' ) );
71
+			add_action( 'admin_print_styles-'.$hook_suffix, array( $this, 'admin_css' ) );
72 72
 		}
73 73
 	}
74 74
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 		wp_enqueue_style(
89 89
 			'proanmic-pay-admin-about',
90
-			plugins_url( 'css/admin-about' . $min . '.css', $this->plugin->get_file() ),
90
+			plugins_url( 'css/admin-about'.$min.'.css', $this->plugin->get_file() ),
91 91
 			array(),
92 92
 			$this->plugin->get_version()
93 93
 		);
Please login to merge, or discard this patch.
classes/Forms/FormScripts.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
 
48 48
 		wp_register_style(
49 49
 			'pronamic-pay-forms',
50
-			plugins_url( 'css/forms' . $min . '.css', $this->plugin->get_file() ),
50
+			plugins_url( 'css/forms'.$min.'.css', $this->plugin->get_file() ),
51 51
 			array(),
52 52
 			$this->plugin->get_version()
53 53
 		);
Please login to merge, or discard this patch.