Completed
Push — master ( cde0c6...d99bf9 )
by Stephen
15:46
created
tools/i18n/pot-ext-meta.php 1 patch
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,9 @@  discard block
 block discarded – undo
38 38
 		$po = new PO;
39 39
 		foreach($this->headers as $header) {
40 40
 			$string = $makepot->get_addon_header($header, $source);
41
-			if (!$string) continue;
41
+			if (!$string) {
42
+				continue;
43
+			}
42 44
 			$args = array(
43 45
 				'singular' => $string,
44 46
 				'extracted_comments' => $header.' of the plugin/theme',
@@ -50,17 +52,22 @@  discard block
 block discarded – undo
50 52
 	}
51 53
 
52 54
 	function append( $ext_filename, $pot_filename, $headers = null ) {
53
-		if ( $headers )
54
-			$this->headers = (array) $headers;
55
+		if ( $headers ) {
56
+					$this->headers = (array) $headers;
57
+		}
55 58
 		if ( is_dir( $ext_filename ) ) {
56 59
 			$pot = implode('', array_map(array($this, 'load_from_file'), glob("$ext_filename/*.php")));
57 60
 		} else {
58 61
 			$pot = $this->load_from_file($ext_filename);
59 62
 		}
60 63
 		$potf = '-' == $pot_filename? STDOUT : fopen($pot_filename, 'a');
61
-		if (!$potf) return false;
64
+		if (!$potf) {
65
+			return false;
66
+		}
62 67
 		fwrite($potf, $pot);
63
-		if ('-' != $pot_filename) fclose($potf);
68
+		if ('-' != $pot_filename) {
69
+			fclose($potf);
70
+		}
64 71
 		return true;
65 72
 	}
66 73
 }
Please login to merge, or discard this patch.
tools/i18n/not-gettexted.php 1 patch
Braces   +34 added lines, -20 removed lines patch added patch discarded remove patch
@@ -7,10 +7,11 @@  discard block
 block discarded – undo
7 7
  * @subpackage tools
8 8
  */
9 9
 // see: http://php.net/tokenizer
10
-if ( ! defined( 'T_ML_COMMENT' ) )
10
+if ( ! defined( 'T_ML_COMMENT' ) ) {
11 11
 	    define( 'T_ML_COMMENT', T_COMMENT );
12
-else
12
+} else {
13 13
 	    define( 'T_DOC_COMMENT', T_ML_COMMENT );
14
+}
14 15
 
15 16
 $pomo = dirname( dirname( dirname( __FILE__ ) ) ) . '/src/wp-includes/pomo';
16 17
 require_once "$pomo/po.php";
@@ -31,7 +32,9 @@  discard block
 block discarded – undo
31 32
 
32 33
 	function logmsg() {
33 34
 		$args = func_get_args();
34
-		if ($this->enable_logging) error_log(implode(' ', $args));
35
+		if ($this->enable_logging) {
36
+			error_log(implode(' ', $args));
37
+		}
35 38
 	}
36 39
 
37 40
 	function stderr($msg, $nl=true) {
@@ -56,12 +59,15 @@  discard block
 block discarded – undo
56 59
 		$items = scandir( $dir );
57 60
 		foreach ( (array) $items as $item ) {
58 61
 			$full_item = $dir . '/' . $item;
59
-			if ('.' == $item || '..' == $item)
60
-				continue;
61
-			if ('.php' == substr($item, -4))
62
-				$files[] = $full_item;
63
-			if (is_dir($full_item))
64
-				$files += array_merge($files, NotGettexted::list_php_files($full_item, $files));
62
+			if ('.' == $item || '..' == $item) {
63
+							continue;
64
+			}
65
+			if ('.php' == substr($item, -4)) {
66
+							$files[] = $full_item;
67
+			}
68
+			if (is_dir($full_item)) {
69
+							$files += array_merge($files, NotGettexted::list_php_files($full_item, $files));
70
+			}
65 71
 		}
66 72
 		return $files;
67 73
 	}
@@ -102,7 +108,9 @@  discard block
 block discarded – undo
102 108
 						$stage = $this->STAGE_END_COMMENT;
103 109
 						$this->logmsg('end comment', $current_comment_id);
104 110
 						$result .= call_user_func($other_action, $token);
105
-						if (!is_null($register_action)) call_user_func($register_action, $current_string, $current_comment_id, $current_string_line);
111
+						if (!is_null($register_action)) {
112
+							call_user_func($register_action, $current_string, $current_comment_id, $current_string_line);
113
+						}
106 114
 						continue;
107 115
 					}
108 116
 				} else if (T_CONSTANT_ENCAPSED_STRING == $id) {
@@ -141,10 +149,11 @@  discard block
 block discarded – undo
141 149
 	function command_extract() {
142 150
 		$args = func_get_args();
143 151
 		$pot_filename = $args[0];
144
-		if (isset($args[1]) && is_array($args[1]))
145
-			$filenames = $args[1];
146
-		else
147
-			$filenames = array_slice($args, 1);
152
+		if (isset($args[1]) && is_array($args[1])) {
153
+					$filenames = $args[1];
154
+		} else {
155
+					$filenames = array_slice($args, 1);
156
+		}
148 157
 
149 158
 		$global_name = '__entries_'.mt_rand(1, 1000);
150 159
 		$GLOBALS[$global_name] = array();
@@ -172,17 +181,20 @@  discard block
 block discarded – undo
172 181
 			$entry = new Translation_Entry($args);
173 182
 			fwrite($potf, "\n".PO::export_entry($entry)."\n");
174 183
 		}
175
-		if ('-' != $pot_filename) fclose($potf);
184
+		if ('-' != $pot_filename) {
185
+			fclose($potf);
186
+		}
176 187
 		return true;
177 188
 	}
178 189
 
179 190
 	function command_replace() {
180 191
 		$args = func_get_args();
181 192
 		$mo_filename = $args[0];
182
-		if (isset($args[1]) && is_array($args[1]))
183
-			$filenames = $args[1];
184
-		else
185
-			$filenames = array_slice($args, 1);
193
+		if (isset($args[1]) && is_array($args[1])) {
194
+					$filenames = $args[1];
195
+		} else {
196
+					$filenames = array_slice($args, 1);
197
+		}
186 198
 
187 199
 		$global_name = '__mo_'.mt_rand(1, 1000);
188 200
 		$GLOBALS[$global_name] = new MO();
@@ -194,7 +206,9 @@  discard block
 block discarded – undo
194 206
 		}
195 207
 		foreach($filenames as $filename) {
196 208
 			$source = file_get_contents($filename);
197
-			if ( strlen($source) > 150000 ) continue;
209
+			if ( strlen($source) > 150000 ) {
210
+				continue;
211
+			}
198 212
 			$tokens = token_get_all($source);
199 213
 			$new_file = $this->walk_tokens($tokens, $replacer, array($this, 'unchanged_token'));
200 214
 			$f = fopen($filename, 'w');
Please login to merge, or discard this patch.
tools/i18n/t/data/not-gettexted-0.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,11 @@
 block discarded – undo
2 2
 
3 3
 if (! isset($wp_did_header)):
4 4
 if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) {
5
-	if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = '';
6
-	else $path = 'wp-admin/';
5
+	if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) {
6
+		$path = '';
7
+	} else {
8
+		$path = 'wp-admin/';
9
+	}
7 10
 
8 11
 	require_once( dirname(__FILE__) . '/wp-includes/classes.php');
9 12
 	require_once( dirname(__FILE__) . '/wp-includes/functions.php');
Please login to merge, or discard this patch.
tools/i18n/extract.php 1 patch
Braces   +29 added lines, -12 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@  discard block
 block discarded – undo
26 26
 		$translations = new Translations;
27 27
 		$file_names = (array) scandir( '.' );
28 28
 		foreach ( $file_names as $file_name ) {
29
-			if ( '.' == $file_name || '..' == $file_name ) continue;
29
+			if ( '.' == $file_name || '..' == $file_name ) {
30
+				continue;
31
+			}
30 32
 			if ( preg_match( '/\.php$/', $file_name ) && $this->does_file_name_match( $prefix . $file_name, $excludes, $includes ) ) {
31 33
 				$extracted = $this->extract_from_file( $file_name, $prefix );
32 34
 				$translations->merge_originals_with( $extracted );
@@ -54,7 +56,9 @@  discard block
 block discarded – undo
54 56
 					break;
55 57
 				}
56 58
 			}
57
-			if ( !$matched_any_include ) return false;
59
+			if ( !$matched_any_include ) {
60
+				return false;
61
+			}
58 62
 		}
59 63
 		if ( $excludes ) {
60 64
 			foreach( $excludes as $exclude ) {
@@ -68,12 +72,16 @@  discard block
 block discarded – undo
68 72
 
69 73
 	function entry_from_call( $call, $file_name ) {
70 74
 		$rule = isset( $this->rules[$call['name']] )? $this->rules[$call['name']] : null;
71
-		if ( !$rule ) return null;
75
+		if ( !$rule ) {
76
+			return null;
77
+		}
72 78
 		$entry = new Translation_Entry;
73 79
 		$multiple = array();
74 80
 		$complete = false;
75 81
 		for( $i = 0; $i < count( $rule ); ++$i ) {
76
-			if ( $rule[$i] && ( !isset( $call['args'][$i] ) || !is_string( $call['args'][$i] ) || '' == $call['args'][$i] ) ) return false;
82
+			if ( $rule[$i] && ( !isset( $call['args'][$i] ) || !is_string( $call['args'][$i] ) || '' == $call['args'][$i] ) ) {
83
+				return false;
84
+			}
77 85
 			switch( $rule[$i] ) {
78 86
 			case 'string':
79 87
 				if ( $complete ) {
@@ -133,11 +141,12 @@  discard block
 block discarded – undo
133 141
 		$function_calls = $this->find_function_calls( array_keys( $this->rules ), $code );
134 142
 		foreach( $function_calls as $call ) {
135 143
 			$entry = $this->entry_from_call( $call, $file_name );
136
-			if ( is_array( $entry ) )
137
-				foreach( $entry as $single_entry )
144
+			if ( is_array( $entry ) ) {
145
+							foreach( $entry as $single_entry )
138 146
 					$translations->add_entry_or_merge( $single_entry );
139
-			elseif ( $entry)
140
-				$translations->add_entry_or_merge( $entry );
147
+			} elseif ( $entry) {
148
+							$translations->add_entry_or_merge( $entry );
149
+			}
141 150
 		}
142 151
 		return $translations;
143 152
 	}
@@ -155,8 +164,12 @@  discard block
 block discarded – undo
155 164
 		$in_func = false;
156 165
 		foreach( $tokens as $token ) {
157 166
 			$id = $text = null;
158
-			if ( is_array( $token ) ) list( $id, $text, $line ) = $token;
159
-			if ( T_WHITESPACE == $id ) continue;
167
+			if ( is_array( $token ) ) {
168
+				list( $id, $text, $line ) = $token;
169
+			}
170
+			if ( T_WHITESPACE == $id ) {
171
+				continue;
172
+			}
160 173
 			if ( T_STRING == $id && in_array( $text, $function_names ) && !$in_func ) {
161 174
 				$in_func = true;
162 175
 				$paren_level = -1;
@@ -177,7 +190,9 @@  discard block
 block discarded – undo
177 190
 					$latest_comment = $text;
178 191
 				}
179 192
 			}
180
-			if ( !$in_func ) continue;
193
+			if ( !$in_func ) {
194
+				continue;
195
+			}
181 196
 			if ( '(' == $token ) {
182 197
 				$paren_level++;
183 198
 				if ( 0 == $paren_level ) { // start of first argument
@@ -197,7 +212,9 @@  discard block
 block discarded – undo
197 212
 					$in_func = false;
198 213
 					$args[] = $current_argument;
199 214
 					$call = array( 'name' => $func_name, 'args' => $args, 'line' => $func_line );
200
-					if ( $func_comment ) $call['comment'] = $func_comment;
215
+					if ( $func_comment ) {
216
+						$call['comment'] = $func_comment;
217
+					}
201 218
 					$function_calls[] = $call;
202 219
 				}
203 220
 				$paren_level--;
Please login to merge, or discard this patch.
src/xmlrpc.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@  discard block
 block discarded – undo
22 22
 }
23 23
 
24 24
 // fix for mozBlog and other cases where '<?xml' isn't on the very first line
25
-if ( isset($HTTP_RAW_POST_DATA) )
25
+if ( isset($HTTP_RAW_POST_DATA) ) {
26 26
 	$HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);
27
+}
27 28
 
28 29
 /** Include the bootstrap for setting up WordPress environment */
29 30
 include( dirname( __FILE__ ) . '/wp-load.php' );
@@ -96,6 +97,7 @@  discard block
 block discarded – undo
96 97
  */
97 98
 function logIO( $io, $msg ) {
98 99
 	_deprecated_function( __FUNCTION__, '3.4', 'error_log()' );
99
-	if ( ! empty( $GLOBALS['xmlrpc_logging'] ) )
100
-		error_log( $io . ' - ' . $msg );
101
-}
102 100
\ No newline at end of file
101
+	if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) {
102
+			error_log( $io . ' - ' . $msg );
103
+	}
104
+	}
103 105
\ No newline at end of file
Please login to merge, or discard this patch.
src/wp-cron.php 1 patch
Braces   +22 added lines, -13 removed lines patch added patch discarded remove patch
@@ -11,8 +11,9 @@  discard block
 block discarded – undo
11 11
 
12 12
 ignore_user_abort(true);
13 13
 
14
-if ( !empty($_POST) || defined('DOING_AJAX') || defined('DOING_CRON') )
14
+if ( !empty($_POST) || defined('DOING_AJAX') || defined('DOING_CRON') ) {
15 15
 	die();
16
+}
16 17
 
17 18
 /**
18 19
  * Tell WordPress we are doing the CRON task.
@@ -48,21 +49,24 @@  discard block
 block discarded – undo
48 49
 		$value = wp_cache_get( 'doing_cron', 'transient', true );
49 50
 	} else {
50 51
 		$row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", '_transient_doing_cron' ) );
51
-		if ( is_object( $row ) )
52
-			$value = $row->option_value;
52
+		if ( is_object( $row ) ) {
53
+					$value = $row->option_value;
54
+		}
53 55
 	}
54 56
 
55 57
 	return $value;
56 58
 }
57 59
 
58
-if ( false === $crons = _get_cron_array() )
60
+if ( false === $crons = _get_cron_array() ) {
59 61
 	die();
62
+}
60 63
 
61 64
 $keys = array_keys( $crons );
62 65
 $gmt_time = microtime( true );
63 66
 
64
-if ( isset($keys[0]) && $keys[0] > $gmt_time )
67
+if ( isset($keys[0]) && $keys[0] > $gmt_time ) {
65 68
 	die();
69
+}
66 70
 
67 71
 
68 72
 // The cron lock: a unix timestamp from when the cron was spawned.
@@ -72,8 +76,9 @@  discard block
 block discarded – undo
72 76
 if ( empty( $doing_wp_cron ) ) {
73 77
 	if ( empty( $_GET[ 'doing_wp_cron' ] ) ) {
74 78
 		// Called from external script/job. Try setting a lock.
75
-		if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) )
76
-			return;
79
+		if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) ) {
80
+					return;
81
+		}
77 82
 		$doing_cron_transient = $doing_wp_cron = sprintf( '%.22F', microtime( true ) );
78 83
 		set_transient( 'doing_cron', $doing_wp_cron );
79 84
 	} else {
@@ -85,12 +90,14 @@  discard block
 block discarded – undo
85 90
  * The cron lock (a unix timestamp set when the cron was spawned),
86 91
  * must match $doing_wp_cron (the "key").
87 92
  */
88
-if ( $doing_cron_transient != $doing_wp_cron )
93
+if ( $doing_cron_transient != $doing_wp_cron ) {
89 94
 	return;
95
+}
90 96
 
91 97
 foreach ( $crons as $timestamp => $cronhooks ) {
92
-	if ( $timestamp > $gmt_time )
93
-		break;
98
+	if ( $timestamp > $gmt_time ) {
99
+			break;
100
+	}
94 101
 
95 102
 	foreach ( $cronhooks as $hook => $keys ) {
96 103
 
@@ -117,13 +124,15 @@  discard block
 block discarded – undo
117 124
  			do_action_ref_array( $hook, $v['args'] );
118 125
 
119 126
 			// If the hook ran too long and another cron process stole the lock, quit.
120
-			if ( _get_cron_lock() != $doing_wp_cron )
121
-				return;
127
+			if ( _get_cron_lock() != $doing_wp_cron ) {
128
+							return;
129
+			}
122 130
 		}
123 131
 	}
124 132
 }
125 133
 
126
-if ( _get_cron_lock() == $doing_wp_cron )
134
+if ( _get_cron_lock() == $doing_wp_cron ) {
127 135
 	delete_transient( 'doing_cron' );
136
+}
128 137
 
129 138
 die();
Please login to merge, or discard this patch.
src/wp-content/themes/twentytwelve/image.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,9 +54,10 @@  discard block
 block discarded – undo
54 54
  */
55 55
 $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
56 56
 foreach ( $attachments as $k => $attachment ) :
57
-	if ( $attachment->ID == $post->ID )
58
-		break;
59
-endforeach;
57
+	if ( $attachment->ID == $post->ID ) {
58
+			break;
59
+	}
60
+	endforeach;
60 61
 
61 62
 // If there is more than 1 attachment in a gallery
62 63
 if ( count( $attachments ) > 1 ) :
@@ -64,13 +65,17 @@  discard block
 block discarded – undo
64 65
 	if ( isset( $attachments[ $k ] ) ) :
65 66
 		// get the URL of the next image attachment
66 67
 		$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
67
-	else :
68
+	else {
69
+		:
68 70
 		// or get the URL of the first image attachment
69 71
 		$next_attachment_url = get_attachment_link( $attachments[0]->ID );
72
+	}
70 73
 	endif;
71
-else :
74
+else {
75
+	:
72 76
 	// or, if there's only 1 image, get the URL of the image
73 77
 	$next_attachment_url = wp_get_attachment_url();
78
+}
74 79
 endif;
75 80
 ?>
76 81
 								<a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
Please login to merge, or discard this patch.
src/wp-content/themes/twentytwelve/sidebar-front.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@
 block discarded – undo
15 15
  *
16 16
  * If none of the sidebars have widgets, then let's bail early.
17 17
  */
18
-if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) )
18
+if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) ) {
19 19
 	return;
20
+}
20 21
 
21 22
 // If we get this far, we have widgets. Let do this.
22 23
 ?>
Please login to merge, or discard this patch.
src/wp-content/themes/twentytwelve/index.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@  discard block
 block discarded – undo
27 27
 
28 28
 			<?php twentytwelve_content_nav( 'nav-below' ); ?>
29 29
 
30
-		<?php else : ?>
30
+		<?php else {
31
+	: ?>
31 32
 
32 33
 			<article id="post-0" class="post no-results not-found">
33 34
 
@@ -35,18 +36,23 @@  discard block
 block discarded – undo
35 36
 				// Show a different message to a logged-in user who can add posts.
36 37
 			?>
37 38
 				<header class="entry-header">
38
-					<h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1>
39
+					<h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' );
40
+}
41
+?></h1>
39 42
 				</header>
40 43
 
41 44
 				<div class="entry-content">
42 45
 					<p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>
43 46
 				</div><!-- .entry-content -->
44 47
 
45
-			<?php else :
48
+			<?php else {
49
+	:
46 50
 				// Show the default message to everyone else.
47 51
 			?>
48 52
 				<header class="entry-header">
49
-					<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
53
+					<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' );
54
+}
55
+?></h1>
50 56
 				</header>
51 57
 
52 58
 				<div class="entry-content">
Please login to merge, or discard this patch.