Passed
Push — main ( aaef5c...e4c121 )
by TARIQ
71:39
created
wp/wp-includes/theme.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3675,9 +3675,12 @@
 block discarded – undo
3675 3675
 
3676 3676
 	<?php	if ( $cross_domain ) : ?>
3677 3677
 			request = (function(){ var xhr = new XMLHttpRequest(); return ('withCredentials' in xhr); })();
3678
-	<?php	else : ?>
3678
+	<?php	else {
3679
+    : ?>
3679 3680
 			request = true;
3680
-	<?php	endif; ?>
3681
+	<?php	endif;
3682
+}
3683
+?>
3681 3684
 
3682 3685
 			b[c] = b[c].replace( rcs, ' ' );
3683 3686
 			// The customizer requires postMessage and CORS (if the site is cross domain).
Please login to merge, or discard this patch.
wp/wp-includes/class-requests.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -372,8 +372,7 @@  discard block
 block discarded – undo
372 372
 			if (is_string($options['transport'])) {
373 373
 				$transport = new $transport();
374 374
 			}
375
-		}
376
-		else {
375
+		} else {
377 376
 			$need_ssl     = (stripos($url, 'https://') === 0);
378 377
 			$capabilities = array('ssl' => $need_ssl);
379 378
 			$transport    = self::get_transport($capabilities);
@@ -449,8 +448,7 @@  discard block
 block discarded – undo
449 448
 			if (!isset($request['options'])) {
450 449
 				$request['options']         = $options;
451 450
 				$request['options']['type'] = $request['type'];
452
-			}
453
-			else {
451
+			} else {
454 452
 				if (empty($request['options']['type'])) {
455 453
 					$request['options']['type'] = $request['type'];
456 454
 				}
@@ -475,8 +473,7 @@  discard block
 block discarded – undo
475 473
 			if (is_string($options['transport'])) {
476 474
 				$transport = new $transport();
477 475
 			}
478
-		}
479
-		else {
476
+		} else {
480 477
 			$transport = self::get_transport();
481 478
 		}
482 479
 		$responses = $transport->request_multiple($requests, $options);
@@ -586,8 +583,7 @@  discard block
 block discarded – undo
586 583
 
587 584
 		if (is_array($options['cookies'])) {
588 585
 			$options['cookies'] = new Requests_Cookie_Jar($options['cookies']);
589
-		}
590
-		elseif (empty($options['cookies'])) {
586
+		} elseif (empty($options['cookies'])) {
591 587
 			$options['cookies'] = new Requests_Cookie_Jar();
592 588
 		}
593 589
 		if ($options['cookies'] !== false) {
@@ -606,8 +602,7 @@  discard block
 block discarded – undo
606 602
 		if (!isset($options['data_format'])) {
607 603
 			if (in_array($type, array(self::HEAD, self::GET, self::DELETE), true)) {
608 604
 				$options['data_format'] = 'query';
609
-			}
610
-			else {
605
+			} else {
611 606
 				$options['data_format'] = 'body';
612 607
 			}
613 608
 		}
@@ -711,8 +706,7 @@  discard block
 block discarded – undo
711 706
 				$redirected            = self::request($location, $req_headers, $req_data, $options['type'], $options);
712 707
 				$redirected->history[] = $return;
713 708
 				return $redirected;
714
-			}
715
-			elseif ($options['redirected'] >= $options['redirects']) {
709
+			} elseif ($options['redirected'] >= $options['redirects']) {
716 710
 				throw new Requests_Exception('Too many redirects', 'toomanyredirects', $return);
717 711
 			}
718 712
 		}
@@ -740,8 +734,7 @@  discard block
 block discarded – undo
740 734
 			$data     = $request['data'];
741 735
 			$options  = $request['options'];
742 736
 			$response = self::parse_response($response, $url, $headers, $data, $options);
743
-		}
744
-		catch (Requests_Exception $e) {
737
+		} catch (Requests_Exception $e) {
745 738
 			$response = $e;
746 739
 		}
747 740
 	}
Please login to merge, or discard this patch.
wp/wp-includes/atomlib.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -168,7 +168,9 @@  discard block
 block discarded – undo
168 168
 
169 169
         $fp = fopen($this->FILE, "r");
170 170
         while ($data = fread($fp, 4096)) {
171
-            if($this->debug) $this->content .= $data;
171
+            if($this->debug) {
172
+                $this->content .= $data;
173
+            }
172 174
 
173 175
             if(!xml_parse($parser, $data, feof($fp))) {
174 176
                 /* translators: 1: Error message, 2: Line number. */
@@ -215,8 +217,9 @@  discard block
 block discarded – undo
215 217
 
216 218
             $this->content_ns_decls = array();
217 219
 
218
-            if($this->is_html || $this->is_text)
219
-                trigger_error("Invalid content in element found. Content must not be of type text or html if it contains markup.");
220
+            if($this->is_html || $this->is_text) {
221
+                            trigger_error("Invalid content in element found. Content must not be of type text or html if it contains markup.");
222
+            }
220 223
 
221 224
             $attrs_prefix = array();
222 225
 
Please login to merge, or discard this patch.
wp/wp-includes/theme-compat/comments.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,14 +62,17 @@
 block discarded – undo
62 62
 		<div class="alignleft"><?php previous_comments_link(); ?></div>
63 63
 		<div class="alignright"><?php next_comments_link(); ?></div>
64 64
 	</div>
65
-<?php else : // This is displayed if there are no comments so far. ?>
65
+<?php else {
66
+    : // This is displayed if there are no comments so far. ?>
66 67
 
67 68
 	<?php if ( comments_open() ) : ?>
68 69
 		<!-- If comments are open, but there are no comments. -->
69 70
 
70 71
 	<?php else : // Comments are closed. ?>
71 72
 		<!-- If comments are closed. -->
72
-		<p class="nocomments"><?php _e( 'Comments are closed.' ); ?></p>
73
+		<p class="nocomments"><?php _e( 'Comments are closed.' );
74
+}
75
+?></p>
73 76
 
74 77
 	<?php endif; ?>
75 78
 <?php endif; ?>
Please login to merge, or discard this patch.
wp/wp-includes/theme-compat/embed.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,8 +17,10 @@
 block discarded – undo
17 17
 		the_post();
18 18
 		get_template_part( 'embed', 'content' );
19 19
 	endwhile;
20
-else :
20
+else {
21
+    :
21 22
 	get_template_part( 'embed', '404' );
23
+}
22 24
 endif;
23 25
 
24 26
 get_footer( 'embed' );
Please login to merge, or discard this patch.
wp/wp-includes/ms-deprecated.php 1 patch
Braces   +42 added lines, -30 removed lines patch added patch discarded remove patch
@@ -66,12 +66,14 @@  discard block
 block discarded – undo
66 66
 
67 67
 	if ( empty( $user_login ) ) {
68 68
 		$user_id = get_current_user_id();
69
-		if ( !$user_id )
70
-			return false;
69
+		if ( !$user_id ) {
70
+					return false;
71
+		}
71 72
 	} else {
72 73
 		$user = get_user_by( 'login', $user_login );
73
-		if ( ! $user->exists() )
74
-			return false;
74
+		if ( ! $user->exists() ) {
75
+					return false;
76
+		}
75 77
 		$user_id = $user->ID;
76 78
 	}
77 79
 
@@ -293,8 +295,9 @@  discard block
 block discarded – undo
293 295
 	if ( isset( $_GET['redirect'] ) && isset( $_POST['redirect'] ) && $_GET['redirect'] !== $_POST['redirect'] ) {
294 296
 		wp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 );
295 297
 	} elseif ( isset( $_GET['redirect'] ) ) {
296
-		if ( 's_' === substr( $_GET['redirect'], 0, 2 ) )
297
-			$url .= '&action=blogs&s='. esc_html( substr( $_GET['redirect'], 2 ) );
298
+		if ( 's_' === substr( $_GET['redirect'], 0, 2 ) ) {
299
+					$url .= '&action=blogs&s='. esc_html( substr( $_GET['redirect'], 2 ) );
300
+		}
298 301
 	} elseif ( isset( $_POST['redirect'] ) ) {
299 302
 		$url = wpmu_admin_redirect_add_updated_param( $_POST['redirect'] );
300 303
 	}
@@ -316,10 +319,11 @@  discard block
 block discarded – undo
316 319
 	_deprecated_function( __FUNCTION__, '3.3.0', 'add_query_arg()' );
317 320
 
318 321
 	if ( strpos( $url, 'updated=true' ) === false ) {
319
-		if ( strpos( $url, '?' ) === false )
320
-			return $url . '?updated=true';
321
-		else
322
-			return $url . '&updated=true';
322
+		if ( strpos( $url, '?' ) === false ) {
323
+					return $url . '?updated=true';
324
+		} else {
325
+					return $url . '&updated=true';
326
+		}
323 327
 	}
324 328
 	return $url;
325 329
 }
@@ -340,15 +344,17 @@  discard block
 block discarded – undo
340 344
 function get_user_id_from_string( $string ) {
341 345
 	_deprecated_function( __FUNCTION__, '3.6.0', 'get_user_by()' );
342 346
 
343
-	if ( is_email( $string ) )
344
-		$user = get_user_by( 'email', $string );
345
-	elseif ( is_numeric( $string ) )
346
-		return $string;
347
-	else
348
-		$user = get_user_by( 'login', $string );
347
+	if ( is_email( $string ) ) {
348
+			$user = get_user_by( 'email', $string );
349
+	} elseif ( is_numeric( $string ) ) {
350
+			return $string;
351
+	} else {
352
+			$user = get_user_by( 'login', $string );
353
+	}
349 354
 
350
-	if ( $user )
351
-		return $user->ID;
355
+	if ( $user ) {
356
+			return $user->ID;
357
+	}
352 358
 	return 0;
353 359
 }
354 360
 
@@ -372,8 +378,9 @@  discard block
 block discarded – undo
372 378
 			$blogname = substr( $domain, 0, strpos( $domain, '.' ) );
373 379
 			$url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path;
374 380
 			// We're not installing the main blog.
375
-			if ( 'www.' !== $blogname )
376
-				$url .= $blogname . '/';
381
+			if ( 'www.' !== $blogname ) {
382
+							$url .= $blogname . '/';
383
+			}
377 384
 		} else { // Main blog.
378 385
 			$url = 'http://' . $domain . $path;
379 386
 		}
@@ -396,12 +403,14 @@  discard block
 block discarded – undo
396 403
 function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) {
397 404
 	_deprecated_function( __FUNCTION__, '4.4.0' );
398 405
 
399
-	if ( empty($path) )
400
-		$path = '/';
406
+	if ( empty($path) ) {
407
+			$path = '/';
408
+	}
401 409
 
402 410
 	// Check if the domain has been used already. We should return an error message.
403
-	if ( domain_exists($domain, $path, $site_id) )
404
-		return __( '<strong>Error</strong>: Site URL you&#8217;ve entered is already taken.' );
411
+	if ( domain_exists($domain, $path, $site_id) ) {
412
+			return __( '<strong>Error</strong>: Site URL you&#8217;ve entered is already taken.' );
413
+	}
405 414
 
406 415
 	/*
407 416
 	 * Need to back up wpdb table names, and create a new wp_blogs entry for new blog.
@@ -409,8 +418,9 @@  discard block
 block discarded – undo
409 418
 	 * Must restore table names at the end of function.
410 419
 	 */
411 420
 
412
-	if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
413
-		return __( '<strong>Error</strong>: There was a problem creating site entry.' );
421
+	if ( ! $blog_id = insert_blog($domain, $path, $site_id) ) {
422
+			return __( '<strong>Error</strong>: There was a problem creating site entry.' );
423
+	}
414 424
 
415 425
 	switch_to_blog($blog_id);
416 426
 	install_blog($blog_id);
@@ -448,8 +458,9 @@  discard block
 block discarded – undo
448 458
 		$network_id = ! empty( $_networks ) ? array_shift( $_networks ) : 0;
449 459
 	}
450 460
 
451
-	if ( $network_id )
452
-		return $wpdb->get_results( $wpdb->prepare( "SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $network_id ), ARRAY_A );
461
+	if ( $network_id ) {
462
+			return $wpdb->get_results( $wpdb->prepare( "SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $network_id ), ARRAY_A );
463
+	}
453 464
 
454 465
 	return false;
455 466
 }
@@ -480,8 +491,9 @@  discard block
 block discarded – undo
480 491
 function wp_get_sites( $args = array() ) {
481 492
 	_deprecated_function( __FUNCTION__, '4.6.0', 'get_sites()' );
482 493
 
483
-	if ( wp_is_large_network() )
484
-		return array();
494
+	if ( wp_is_large_network() ) {
495
+			return array();
496
+	}
485 497
 
486 498
 	$defaults = array(
487 499
 		'network_id' => get_current_network_id(),
Please login to merge, or discard this patch.
wp/wp-includes/media-template.php 1 patch
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -248,9 +248,12 @@  discard block
 block discarded – undo
248 248
 				do_action( 'upload_ui_over_quota' );
249 249
 				?>
250 250
 			</div>
251
-		<?php else : ?>
251
+		<?php else {
252
+    : ?>
252 253
 			<div class="upload-ui">
253
-				<h2 class="upload-instructions drop-instructions"><?php _e( 'Drop files to upload' ); ?></h2>
254
+				<h2 class="upload-instructions drop-instructions"><?php _e( 'Drop files to upload' );
255
+}
256
+?></h2>
254 257
 				<p class="upload-instructions drop-instructions"><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></p>
255 258
 				<button type="button" class="browser button button-hero" aria-labelledby="post-upload-info"><?php _e( 'Select Files' ); ?></button>
256 259
 			</div>
@@ -537,8 +540,11 @@  discard block
 block discarded – undo
537 540
 						<# } else { #>
538 541
 							<button type="button" class="button-link trash-attachment"><?php _e( 'Move to Trash' ); ?></button>
539 542
 						<# } #>
540
-					<?php else : ?>
541
-						<button type="button" class="button-link delete-attachment"><?php _e( 'Delete permanently' ); ?></button>
543
+					<?php else {
544
+    : ?>
545
+						<button type="button" class="button-link delete-attachment"><?php _e( 'Delete permanently' );
546
+}
547
+?></button>
542 548
 					<?php endif; ?>
543 549
 				<# } #>
544 550
 			</div>
@@ -688,8 +694,11 @@  discard block
 block discarded – undo
688 694
 					<# } else { #>
689 695
 						<button type="button" class="button-link trash-attachment"><?php _e( 'Move to Trash' ); ?></button>
690 696
 					<# } #>
691
-					<?php else : ?>
692
-						<button type="button" class="button-link delete-attachment"><?php _e( 'Delete permanently' ); ?></button>
697
+					<?php else {
698
+    : ?>
699
+						<button type="button" class="button-link delete-attachment"><?php _e( 'Delete permanently' );
700
+}
701
+?></button>
693 702
 					<?php endif; ?>
694 703
 				<# } #>
695 704
 
Please login to merge, or discard this patch.
wp/wp-includes/class-json.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -886,8 +886,9 @@
 block discarded – undo
886 886
                             array_pop($stk);
887 887
                             $c++;
888 888
 
889
-                            for ($i = $top['where']; $i <= $c; ++$i)
890
-                                $chrs = substr_replace($chrs, ' ', $i, 1);
889
+                            for ($i = $top['where']; $i <= $c; ++$i) {
890
+                                                            $chrs = substr_replace($chrs, ' ', $i, 1);
891
+                            }
891 892
 
892 893
                             //print("Found end of comment at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n");
893 894
 
Please login to merge, or discard this patch.
wp/wp-includes/ID3/getid3.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -677,8 +677,7 @@
 block discarded – undo
677 677
 						$tag_class = 'getid3_'.$tag_name;
678 678
 						$tag = new $tag_class($this);
679 679
 						$tag->Analyze();
680
-					}
681
-					catch (getid3_exception $e) {
680
+					} catch (getid3_exception $e) {
682 681
 						throw $e;
683 682
 					}
684 683
 				}
Please login to merge, or discard this patch.