Completed
Push — master ( 049abe...7733bc )
by Andrew
10s
created
app/classy/classy-helper.php 3 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -247,57 +247,57 @@
 block discarded – undo
247 247
 
248 248
 		$textdomain = Classy::textdomain();
249 249
 
250
-	    $archives_title = '';
250
+		$archives_title = '';
251 251
 
252
-	    if ( is_category() ) {
252
+		if ( is_category() ) {
253 253
 
254
-	        $archives_title = single_cat_title( '', false );
254
+			$archives_title = single_cat_title( '', false );
255 255
 
256
-	    } else if ( is_tag() ) {
256
+		} else if ( is_tag() ) {
257 257
 
258
-	        $archives_title = 'Tag: ' . single_tag_title( '', false );
258
+			$archives_title = 'Tag: ' . single_tag_title( '', false );
259 259
 
260
-	    } else if ( is_author() ) {
260
+		} else if ( is_author() ) {
261 261
 
262
-	        if ( have_posts() ) {
262
+			if ( have_posts() ) {
263 263
 
264
-	            the_post();
265
-	            $archives_title = 'Author: ' . get_the_author();
264
+				the_post();
265
+				$archives_title = 'Author: ' . get_the_author();
266 266
 
267
-	        }
267
+			}
268 268
 
269
-	        rewind_posts();
269
+			rewind_posts();
270 270
 
271
-	    } else if ( is_search() ) {
271
+		} else if ( is_search() ) {
272 272
 
273
-	        $archives_title = sprintf( __( 'Search Results for: %s', $textdomain ), '<span>' . get_search_query() . '</span>' );
273
+			$archives_title = sprintf( __( 'Search Results for: %s', $textdomain ), '<span>' . get_search_query() . '</span>' );
274 274
 
275
-	    } else if ( is_archive() ) {
275
+		} else if ( is_archive() ) {
276 276
 
277
-	        if ( is_day() ) {
277
+			if ( is_day() ) {
278 278
 
279
-	            $archives_title = get_the_date();
279
+				$archives_title = get_the_date();
280 280
 
281
-	        } elseif ( is_month() ) {
281
+			} elseif ( is_month() ) {
282 282
 
283
-	            $archives_title = get_the_date( _x( 'F Y', 'monthly archives date format', $textdomain ) );
283
+				$archives_title = get_the_date( _x( 'F Y', 'monthly archives date format', $textdomain ) );
284 284
 
285
-	        } elseif ( is_year() ) {
285
+			} elseif ( is_year() ) {
286 286
 
287
-	            $archives_title = get_the_date( _x( 'Y', 'yearly archives date format', $textdomain ) );
287
+				$archives_title = get_the_date( _x( 'Y', 'yearly archives date format', $textdomain ) );
288 288
 
289
-	        } else {
289
+			} else {
290 290
 
291
-	            $archives_title = 'Archives';
291
+				$archives_title = 'Archives';
292 292
 
293
-	        }
293
+			}
294 294
 		} else {
295 295
 
296
-	        $archives_title = 'Archives';
296
+			$archives_title = 'Archives';
297 297
 
298
-	    }
298
+		}
299 299
 
300
-	    return $archives_title;
300
+		return $archives_title;
301 301
 
302 302
 	}
303 303
 }
Please login to merge, or discard this patch.
Spacing   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -15,44 +15,44 @@  discard block
 block discarded – undo
15 15
 	 * @param string  $allowed_tags
16 16
 	 * @return string
17 17
 	 */
18
-	public static function trim_words( $text, $num_words = 55, $more = null, $allowed_tags = 'p a span b i br blockquote' ) {
19
-		if ( null === $more ) {
20
-			$more = __( '&hellip;' );
18
+	public static function trim_words($text, $num_words = 55, $more = null, $allowed_tags = 'p a span b i br blockquote') {
19
+		if (null === $more) {
20
+			$more = __('&hellip;');
21 21
 		}
22 22
 
23 23
 		$original_text = $text;
24 24
 		$allowed_tag_string = '';
25 25
 
26
-		foreach ( explode( ' ', $allowed_tags ) as $tag ) {
27
-			$allowed_tag_string .= '<' . $tag . '>';
26
+		foreach (explode(' ', $allowed_tags) as $tag) {
27
+			$allowed_tag_string .= '<'.$tag.'>';
28 28
 		}
29 29
 
30
-		$text = strip_tags( $text, $allowed_tag_string );
30
+		$text = strip_tags($text, $allowed_tag_string);
31 31
 
32 32
 		/* translators: If your word count is based on single characters (East Asian characters),
33 33
 		enter 'characters'. Otherwise, enter 'words'. Do not translate into your own language. */
34 34
 
35
-		if ( 'characters' == _x( 'words', 'word count: words or characters?' ) && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
36
-			$text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
37
-			preg_match_all( '/./u', $text, $words_array );
38
-			$words_array = array_slice( $words_array[0], 0, $num_words + 1 );
35
+		if ('characters' == _x('words', 'word count: words or characters?') && preg_match('/^utf\-?8$/i', get_option('blog_charset'))) {
36
+			$text = trim(preg_replace("/[\n\r\t ]+/", ' ', $text), ' ');
37
+			preg_match_all('/./u', $text, $words_array);
38
+			$words_array = array_slice($words_array[0], 0, $num_words + 1);
39 39
 			$sep = '';
40 40
 		} else {
41
-			$words_array = preg_split( "/[\n\r\t ]+/", $text, $num_words + 1, PREG_SPLIT_NO_EMPTY );
41
+			$words_array = preg_split("/[\n\r\t ]+/", $text, $num_words + 1, PREG_SPLIT_NO_EMPTY);
42 42
 			$sep = ' ';
43 43
 		}
44 44
 
45
-		if ( count( $words_array ) > $num_words ) {
46
-			array_pop( $words_array );
47
-			$text = implode( $sep, $words_array );
48
-			$text = $text . $more;
45
+		if (count($words_array) > $num_words) {
46
+			array_pop($words_array);
47
+			$text = implode($sep, $words_array);
48
+			$text = $text.$more;
49 49
 		} else {
50
-			$text = implode( $sep, $words_array );
50
+			$text = implode($sep, $words_array);
51 51
 		}
52 52
 
53
-		$text = self::close_tags( $text );
53
+		$text = self::close_tags($text);
54 54
 
55
-		return apply_filters( 'wp_trim_words', $text, $num_words, $more, $original_text );
55
+		return apply_filters('wp_trim_words', $text, $num_words, $more, $original_text);
56 56
 	}
57 57
 
58 58
 
@@ -62,36 +62,36 @@  discard block
 block discarded – undo
62 62
 	 * @param string  $html
63 63
 	 * @return string
64 64
 	 */
65
-	public static function close_tags( $html ) {
65
+	public static function close_tags($html) {
66 66
 		//put all opened tags into an array
67
-		preg_match_all( '#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result );
67
+		preg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);
68 68
 
69 69
 		$openedtags = $result[1];
70 70
 
71 71
 		//put all closed tags into an array
72
-		preg_match_all( '#</([a-z]+)>#iU', $html, $result );
72
+		preg_match_all('#</([a-z]+)>#iU', $html, $result);
73 73
 
74 74
 		$closedtags = $result[1];
75
-		$len_opened = count( $openedtags );
75
+		$len_opened = count($openedtags);
76 76
 
77 77
 		// all tags are closed
78
-		if ( count( $closedtags ) == $len_opened ) {
78
+		if (count($closedtags) == $len_opened) {
79 79
 			return $html;
80 80
 		}
81 81
 
82
-		$openedtags = array_reverse( $openedtags );
82
+		$openedtags = array_reverse($openedtags);
83 83
 
84 84
 		// close tags
85
-		for ( $i = 0; $i < $len_opened; $i++ ) {
86
-			if ( ! in_array( $openedtags[ $i ], $closedtags ) ) {
87
-				$html .= '</' . $openedtags[ $i ] . '>';
85
+		for ($i = 0; $i < $len_opened; $i++) {
86
+			if (!in_array($openedtags[$i], $closedtags)) {
87
+				$html .= '</'.$openedtags[$i].'>';
88 88
 			} else {
89
-				unset( $closedtags[ array_search( $openedtags[ $i ], $closedtags ) ] );
89
+				unset($closedtags[array_search($openedtags[$i], $closedtags)]);
90 90
 			}
91 91
 		}
92 92
 
93
-		$html = str_replace( array( '</br>', '</hr>', '</wbr>' ), '', $html );
94
-		$html = str_replace( array( '<br>', '<hr>', '<wbr>' ), array( '<br />', '<hr />', '<wbr />' ), $html );
93
+		$html = str_replace(array('</br>', '</hr>', '</wbr>'), '', $html);
94
+		$html = str_replace(array('<br>', '<hr>', '<wbr>'), array('<br />', '<hr />', '<wbr />'), $html);
95 95
 
96 96
 		return $html;
97 97
 	}
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
 	 *
102 102
 	 * @param  mixed $arg
103 103
 	 */
104
-	public static function error_log( $arg ) {
105
-		if ( ! WP_DEBUG ) {
104
+	public static function error_log($arg) {
105
+		if (!WP_DEBUG) {
106 106
 			return;
107 107
 		}
108
-		if ( is_object( $arg ) || is_array( $arg ) ) {
109
-			$arg = print_r( $arg, true );
108
+		if (is_object($arg) || is_array($arg)) {
109
+			$arg = print_r($arg, true);
110 110
 		}
111
-		return error_log( $arg );
111
+		return error_log($arg);
112 112
 	}
113 113
 
114 114
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * @param string  $args
118 118
 	 * @return array
119 119
 	 */
120
-	public static function paginate_links( $args = '' ) {
120
+	public static function paginate_links($args = '') {
121 121
 		$defaults = array(
122 122
 			'base' => '%_%', // http://example.com/all_posts.php%_% : %_% is replaced by format (below)
123 123
 			'format' => '?page=%#%', // ?page=%#% : %#% is replaced by the page number
@@ -125,43 +125,43 @@  discard block
 block discarded – undo
125 125
 			'current' => 0,
126 126
 			'show_all' => false,
127 127
 			'prev_next' => true,
128
-			'prev_text' => __( '&laquo; Previous' ),
129
-			'next_text' => __( 'Next &raquo;' ),
128
+			'prev_text' => __('&laquo; Previous'),
129
+			'next_text' => __('Next &raquo;'),
130 130
 			'end_size' => 1,
131 131
 			'mid_size' => 2,
132 132
 			'type' => 'array',
133 133
 			'add_args' => false, // array of query args to add
134 134
 			'add_fragment' => '',
135 135
 		);
136
-		$args = wp_parse_args( $args, $defaults );
136
+		$args = wp_parse_args($args, $defaults);
137 137
 		// Who knows what else people pass in $args
138
-		$args['total'] = intval( (int) $args['total'] );
139
-		if ( $args['total'] < 2 ) {
138
+		$args['total'] = intval((int) $args['total']);
139
+		if ($args['total'] < 2) {
140 140
 			return array();
141 141
 		}
142 142
 		$args['current'] = (int) $args['current'];
143 143
 		$args['end_size'] = 0 < (int) $args['end_size'] ? (int) $args['end_size'] : 1; // Out of bounds?  Make it the default.
144 144
 		$args['mid_size'] = 0 <= (int) $args['mid_size'] ? (int) $args['mid_size'] : 2;
145
-		$args['add_args'] = is_array( $args['add_args'] ) ? $args['add_args'] : false;
145
+		$args['add_args'] = is_array($args['add_args']) ? $args['add_args'] : false;
146 146
 		$page_links = array();
147 147
 		$dots = false;
148
-		if ( $args['prev_next'] && $args['current'] && 1 < $args['current'] ) {
149
-			$link = str_replace( '%_%', 2 == $args['current'] ? '' : $args['format'], $args['base'] );
150
-			$link = str_replace( '%#%', $args['current'] - 1, $link );
151
-			if ( $args['add_args'] ) {
152
-				$link = add_query_arg( $args['add_args'], $link );
148
+		if ($args['prev_next'] && $args['current'] && 1 < $args['current']) {
149
+			$link = str_replace('%_%', 2 == $args['current'] ? '' : $args['format'], $args['base']);
150
+			$link = str_replace('%#%', $args['current'] - 1, $link);
151
+			if ($args['add_args']) {
152
+				$link = add_query_arg($args['add_args'], $link);
153 153
 			}
154 154
 			$link .= $args['add_fragment'];
155
-			$link = untrailingslashit( $link );
155
+			$link = untrailingslashit($link);
156 156
 			$page_links[] = array(
157 157
 				'class' => 'prev page-numbers',
158
-				'link' => esc_url( apply_filters( 'paginate_links', $link ) ),
158
+				'link' => esc_url(apply_filters('paginate_links', $link)),
159 159
 				'title' => $args['prev_text'],
160 160
 			);
161 161
 		}
162
-		for ( $n = 1; $n <= $args['total']; $n++ ) {
163
-			$n_display = number_format_i18n( $n );
164
-			if ( $n == $args['current'] ) {
162
+		for ($n = 1; $n <= $args['total']; $n++) {
163
+			$n_display = number_format_i18n($n);
164
+			if ($n == $args['current']) {
165 165
 				$page_links[] = array(
166 166
 					'class' => 'page-number page-numbers current',
167 167
 					'title' => $n_display,
@@ -171,42 +171,42 @@  discard block
 block discarded – undo
171 171
 				);
172 172
 				$dots = true;
173 173
 			} else {
174
-				if ( $args['show_all'] || ( $n <= $args['end_size'] || ( $args['current'] && $n >= $args['current'] - $args['mid_size'] && $n <= $args['current'] + $args['mid_size'] ) || $n > $args['total'] - $args['end_size'] ) ) {
175
-					$link = str_replace( '%_%', 1 == $n ? '' : $args['format'], $args['base'] );
176
-					$link = str_replace( '%#%', $n, $link );
177
-					$link = trailingslashit( $link ) . ltrim( $args['add_fragment'], '/' );
178
-					if ( $args['add_args'] ) {
179
-						$link = rtrim( add_query_arg( $args['add_args'], $link ), '/' );
174
+				if ($args['show_all'] || ($n <= $args['end_size'] || ($args['current'] && $n >= $args['current'] - $args['mid_size'] && $n <= $args['current'] + $args['mid_size']) || $n > $args['total'] - $args['end_size'])) {
175
+					$link = str_replace('%_%', 1 == $n ? '' : $args['format'], $args['base']);
176
+					$link = str_replace('%#%', $n, $link);
177
+					$link = trailingslashit($link).ltrim($args['add_fragment'], '/');
178
+					if ($args['add_args']) {
179
+						$link = rtrim(add_query_arg($args['add_args'], $link), '/');
180 180
 					}
181
-					$link = str_replace( ' ', '+', $link );
182
-					$link = untrailingslashit( $link );
181
+					$link = str_replace(' ', '+', $link);
182
+					$link = untrailingslashit($link);
183 183
 					$page_links[] = array(
184 184
 						'class' => 'page-number page-numbers',
185
-						'link' => esc_url( apply_filters( 'paginate_links', $link ) ),
185
+						'link' => esc_url(apply_filters('paginate_links', $link)),
186 186
 						'title' => $n_display,
187 187
 						'name' => $n_display,
188 188
 						'current' => $args['current'] == $n,
189 189
 					);
190 190
 					$dots = true;
191
-				} elseif ( $dots && ! $args['show_all'] ) {
191
+				} elseif ($dots && !$args['show_all']) {
192 192
 					$page_links[] = array(
193 193
 						'class' => 'dots',
194
-						'title' => __( '&hellip;' ),
194
+						'title' => __('&hellip;'),
195 195
 					);
196 196
 					$dots = false;
197 197
 				}
198 198
 			}
199 199
 		}
200
-		if ( $args['prev_next'] && $args['current'] && ( $args['current'] < $args['total'] || -1 == $args['total'] ) ) {
201
-			$link = str_replace( '%_%', $args['format'], $args['base'] );
202
-			$link = str_replace( '%#%', $args['current'] + 1, $link );
203
-			if ( $args['add_args'] ) {
204
-				$link = add_query_arg( $args['add_args'], $link );
200
+		if ($args['prev_next'] && $args['current'] && ($args['current'] < $args['total'] || -1 == $args['total'])) {
201
+			$link = str_replace('%_%', $args['format'], $args['base']);
202
+			$link = str_replace('%#%', $args['current'] + 1, $link);
203
+			if ($args['add_args']) {
204
+				$link = add_query_arg($args['add_args'], $link);
205 205
 			}
206
-			$link = untrailingslashit( trailingslashit( $link ) . $args['add_fragment'] );
206
+			$link = untrailingslashit(trailingslashit($link).$args['add_fragment']);
207 207
 			$page_links[] = array(
208 208
 				'class' => 'next page-numbers',
209
-				'link' => esc_url( apply_filters( 'paginate_links', $link ) ),
209
+				'link' => esc_url(apply_filters('paginate_links', $link)),
210 210
 				'title' => $args['next_text'],
211 211
 			);
212 212
 		}
@@ -220,13 +220,13 @@  discard block
 block discarded – undo
220 220
 	 * @param  array $array
221 221
 	 * @return object
222 222
 	 */
223
-	public static function array_to_object( $array ) {
223
+	public static function array_to_object($array) {
224 224
 		$obj = new stdClass;
225 225
 
226
-		foreach ( $array as $k => $v ) {
227
-			if ( strlen( $k ) ) {
228
-				if ( is_array( $v ) ) {
229
-					$obj->{$k} = self::array_to_object( $v ); //RECURSION
226
+		foreach ($array as $k => $v) {
227
+			if (strlen($k)) {
228
+				if (is_array($v)) {
229
+					$obj->{$k} = self::array_to_object($v); //RECURSION
230 230
 				} else {
231 231
 					$obj->{$k} = $v;
232 232
 				}
@@ -249,42 +249,42 @@  discard block
 block discarded – undo
249 249
 
250 250
 	    $archives_title = '';
251 251
 
252
-	    if ( is_category() ) {
252
+	    if (is_category()) {
253 253
 
254
-	        $archives_title = single_cat_title( '', false );
254
+	        $archives_title = single_cat_title('', false);
255 255
 
256
-	    } else if ( is_tag() ) {
256
+	    } else if (is_tag()) {
257 257
 
258
-	        $archives_title = 'Tag: ' . single_tag_title( '', false );
258
+	        $archives_title = 'Tag: '.single_tag_title('', false);
259 259
 
260
-	    } else if ( is_author() ) {
260
+	    } else if (is_author()) {
261 261
 
262
-	        if ( have_posts() ) {
262
+	        if (have_posts()) {
263 263
 
264 264
 	            the_post();
265
-	            $archives_title = 'Author: ' . get_the_author();
265
+	            $archives_title = 'Author: '.get_the_author();
266 266
 
267 267
 	        }
268 268
 
269 269
 	        rewind_posts();
270 270
 
271
-	    } else if ( is_search() ) {
271
+	    } else if (is_search()) {
272 272
 
273
-	        $archives_title = sprintf( __( 'Search Results for: %s', $textdomain ), '<span>' . get_search_query() . '</span>' );
273
+	        $archives_title = sprintf(__('Search Results for: %s', $textdomain), '<span>'.get_search_query().'</span>');
274 274
 
275
-	    } else if ( is_archive() ) {
275
+	    } else if (is_archive()) {
276 276
 
277
-	        if ( is_day() ) {
277
+	        if (is_day()) {
278 278
 
279 279
 	            $archives_title = get_the_date();
280 280
 
281
-	        } elseif ( is_month() ) {
281
+	        } elseif (is_month()) {
282 282
 
283
-	            $archives_title = get_the_date( _x( 'F Y', 'monthly archives date format', $textdomain ) );
283
+	            $archives_title = get_the_date(_x('F Y', 'monthly archives date format', $textdomain));
284 284
 
285
-	        } elseif ( is_year() ) {
285
+	        } elseif (is_year()) {
286 286
 
287
-	            $archives_title = get_the_date( _x( 'Y', 'yearly archives date format', $textdomain ) );
287
+	            $archives_title = get_the_date(_x('Y', 'yearly archives date format', $textdomain));
288 288
 
289 289
 	        } else {
290 290
 
Please login to merge, or discard this patch.
Braces   +28 added lines, -14 removed lines patch added patch discarded remove patch
@@ -37,7 +37,8 @@  discard block
 block discarded – undo
37 37
 			preg_match_all( '/./u', $text, $words_array );
38 38
 			$words_array = array_slice( $words_array[0], 0, $num_words + 1 );
39 39
 			$sep = '';
40
-		} else {
40
+		}
41
+		else {
41 42
 			$words_array = preg_split( "/[\n\r\t ]+/", $text, $num_words + 1, PREG_SPLIT_NO_EMPTY );
42 43
 			$sep = ' ';
43 44
 		}
@@ -46,7 +47,8 @@  discard block
 block discarded – undo
46 47
 			array_pop( $words_array );
47 48
 			$text = implode( $sep, $words_array );
48 49
 			$text = $text . $more;
49
-		} else {
50
+		}
51
+		else {
50 52
 			$text = implode( $sep, $words_array );
51 53
 		}
52 54
 
@@ -85,7 +87,8 @@  discard block
 block discarded – undo
85 87
 		for ( $i = 0; $i < $len_opened; $i++ ) {
86 88
 			if ( ! in_array( $openedtags[ $i ], $closedtags ) ) {
87 89
 				$html .= '</' . $openedtags[ $i ] . '>';
88
-			} else {
90
+			}
91
+			else {
89 92
 				unset( $closedtags[ array_search( $openedtags[ $i ], $closedtags ) ] );
90 93
 			}
91 94
 		}
@@ -170,7 +173,8 @@  discard block
 block discarded – undo
170 173
 					'current' => true,
171 174
 				);
172 175
 				$dots = true;
173
-			} else {
176
+			}
177
+			else {
174 178
 				if ( $args['show_all'] || ( $n <= $args['end_size'] || ( $args['current'] && $n >= $args['current'] - $args['mid_size'] && $n <= $args['current'] + $args['mid_size'] ) || $n > $args['total'] - $args['end_size'] ) ) {
175 179
 					$link = str_replace( '%_%', 1 == $n ? '' : $args['format'], $args['base'] );
176 180
 					$link = str_replace( '%#%', $n, $link );
@@ -188,7 +192,8 @@  discard block
 block discarded – undo
188 192
 						'current' => $args['current'] == $n,
189 193
 					);
190 194
 					$dots = true;
191
-				} elseif ( $dots && ! $args['show_all'] ) {
195
+				}
196
+				elseif ( $dots && ! $args['show_all'] ) {
192 197
 					$page_links[] = array(
193 198
 						'class' => 'dots',
194 199
 						'title' => __( '&hellip;' ),
@@ -227,7 +232,8 @@  discard block
 block discarded – undo
227 232
 			if ( strlen( $k ) ) {
228 233
 				if ( is_array( $v ) ) {
229 234
 					$obj->{$k} = self::array_to_object( $v ); //RECURSION
230
-				} else {
235
+				}
236
+				else {
231 237
 					$obj->{$k} = $v;
232 238
 				}
233 239
 			}
@@ -253,11 +259,13 @@  discard block
 block discarded – undo
253 259
 
254 260
 	        $archives_title = single_cat_title( '', false );
255 261
 
256
-	    } else if ( is_tag() ) {
262
+	    }
263
+	    else if ( is_tag() ) {
257 264
 
258 265
 	        $archives_title = 'Tag: ' . single_tag_title( '', false );
259 266
 
260
-	    } else if ( is_author() ) {
267
+	    }
268
+	    else if ( is_author() ) {
261 269
 
262 270
 	        if ( have_posts() ) {
263 271
 
@@ -268,30 +276,36 @@  discard block
 block discarded – undo
268 276
 
269 277
 	        rewind_posts();
270 278
 
271
-	    } else if ( is_search() ) {
279
+	    }
280
+	    else if ( is_search() ) {
272 281
 
273 282
 	        $archives_title = sprintf( __( 'Search Results for: %s', $textdomain ), '<span>' . get_search_query() . '</span>' );
274 283
 
275
-	    } else if ( is_archive() ) {
284
+	    }
285
+	    else if ( is_archive() ) {
276 286
 
277 287
 	        if ( is_day() ) {
278 288
 
279 289
 	            $archives_title = get_the_date();
280 290
 
281
-	        } elseif ( is_month() ) {
291
+	        }
292
+	        elseif ( is_month() ) {
282 293
 
283 294
 	            $archives_title = get_the_date( _x( 'F Y', 'monthly archives date format', $textdomain ) );
284 295
 
285
-	        } elseif ( is_year() ) {
296
+	        }
297
+	        elseif ( is_year() ) {
286 298
 
287 299
 	            $archives_title = get_the_date( _x( 'Y', 'yearly archives date format', $textdomain ) );
288 300
 
289
-	        } else {
301
+	        }
302
+	        else {
290 303
 
291 304
 	            $archives_title = 'Archives';
292 305
 
293 306
 	        }
294
-		} else {
307
+		}
308
+		else {
295 309
 
296 310
 	        $archives_title = 'Archives';
297 311
 
Please login to merge, or discard this patch.
app/classy/classy-basis.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,23 +12,23 @@
 block discarded – undo
12 12
 	 * @param  object/array $data
13 13
 	 * @return void
14 14
 	 */
15
-	protected function import( $data ) {
15
+	protected function import($data) {
16 16
 
17
-		if ( is_object( $data ) ) {
17
+		if (is_object($data)) {
18 18
 
19
-			$data = get_object_vars( $data );
19
+			$data = get_object_vars($data);
20 20
 
21 21
 		}
22 22
 
23
-		if ( is_array( $data ) ) {
23
+		if (is_array($data)) {
24 24
 
25
-			foreach ( $data as $key => $value ) {
25
+			foreach ($data as $key => $value) {
26 26
 
27
-				if ( ! empty( $key ) ) {
27
+				if (!empty($key)) {
28 28
 
29 29
 					$this->$key = $value;
30 30
 
31
-				} else if ( ! empty( $key ) && ! method_exists( $this, $key ) ) {
31
+				} else if (!empty($key) && !method_exists($this, $key)) {
32 32
 
33 33
 					$this->$key = $value;
34 34
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@
 block discarded – undo
28 28
 
29 29
 					$this->$key = $value;
30 30
 
31
-				} else if ( ! empty( $key ) && ! method_exists( $this, $key ) ) {
31
+				}
32
+				else if ( ! empty( $key ) && ! method_exists( $this, $key ) ) {
32 33
 
33 34
 					$this->$key = $value;
34 35
 
Please login to merge, or discard this patch.
app/classy/classy-view.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 
24 24
 		$request = ClassyHierarchy::get_current_request();
25 25
 
26
-		$file = ClassyHierarchy::get_available_file( 'view', $request );
26
+		$file = ClassyHierarchy::get_available_file('view', $request);
27 27
 
28
-		$view = self::get_blade_view( $file );
28
+		$view = self::get_blade_view($file);
29 29
 
30 30
 		return $view;
31 31
 
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 	 * @param  string $view
39 39
 	 * @return string
40 40
 	 */
41
-	public static function get_blade_view( $view ) {
41
+	public static function get_blade_view($view) {
42 42
 
43
-		return str_replace( '/', '.', $view );
43
+		return str_replace('/', '.', $view);
44 44
 
45 45
 	}
46 46
 
@@ -54,21 +54,21 @@  discard block
 block discarded – undo
54 54
 
55 55
 		$templates = array();
56 56
 
57
-		$files = (array) glob( THEME_PATH . '/' . self::$folder . '/*/*.blade.php' );
57
+		$files = (array) glob(THEME_PATH.'/'.self::$folder.'/*/*.blade.php');
58 58
 
59
-		foreach ( $files as $filename ) {
59
+		foreach ($files as $filename) {
60 60
 
61
-			if ( ! empty( $filename ) ) {
61
+			if (!empty($filename)) {
62 62
 
63
-				if ( ! preg_match( '/\{\{\-\-\s*Template Name:(.*)\s*\-\-\}\}/mi', file_get_contents( $filename ), $header ) ) { continue; }
63
+				if (!preg_match('/\{\{\-\-\s*Template Name:(.*)\s*\-\-\}\}/mi', file_get_contents($filename), $header)) { continue; }
64 64
 
65
-				$template_name = trim( $header[1] );
65
+				$template_name = trim($header[1]);
66 66
 
67
-				preg_match( '/\/([^\/]*)\.blade.php$/is', $filename, $filename_match );
67
+				preg_match('/\/([^\/]*)\.blade.php$/is', $filename, $filename_match);
68 68
 
69
-				$template_file = 'classy-' . $filename_match[1];
69
+				$template_file = 'classy-'.$filename_match[1];
70 70
 
71
-				$templates[ $template_file ] = $template_name;
71
+				$templates[$template_file] = $template_name;
72 72
 
73 73
 			}
74 74
 		}
Please login to merge, or discard this patch.
app/classy/classy-menu.php 2 patches
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -23,25 +23,25 @@  discard block
 block discarded – undo
23 23
 	 *
24 24
 	 * @param string $arg it can be menu id, slug or full name
25 25
 	 */
26
-	public function __construct( $arg = null ) {
26
+	public function __construct($arg = null) {
27 27
 
28
-		if ( is_numeric( $arg ) && 0 != $arg ) {
28
+		if (is_numeric($arg) && 0 != $arg) {
29 29
 
30
-			$menu_id = $this->check_menu_id( $arg );
30
+			$menu_id = $this->check_menu_id($arg);
31 31
 
32
-		} elseif ( is_string( $arg ) ) {
32
+		} elseif (is_string($arg)) {
33 33
 
34
-			$menu_id = $this->get_menu_id_by_name( $arg );
34
+			$menu_id = $this->get_menu_id_by_name($arg);
35 35
 
36 36
 		}
37 37
 
38
-		if ( ! isset( $menu_id ) ) {
38
+		if (!isset($menu_id)) {
39 39
 
40 40
 			$menu_id = $this->get_first_menu_id();
41 41
 
42 42
 		}
43 43
 
44
-		if ( $menu_id ) {
44
+		if ($menu_id) {
45 45
 
46 46
 			$this->ID = $menu_id;
47 47
 
@@ -60,22 +60,22 @@  discard block
 block discarded – undo
60 60
 
61 61
 		$_return = array();
62 62
 
63
-		$items = wp_get_nav_menu_items( $this->ID );
63
+		$items = wp_get_nav_menu_items($this->ID);
64 64
 
65
-		foreach ( $items as $item ) {
65
+		foreach ($items as $item) {
66 66
 
67
-			$_return[ $item->ID ] = new ClassyMenuItem( $item );
67
+			$_return[$item->ID] = new ClassyMenuItem($item);
68 68
 		}
69 69
 
70 70
 		// Apply nesting
71 71
 
72
-		foreach ( $_return as $item_id => $item ) {
72
+		foreach ($_return as $item_id => $item) {
73 73
 
74
-			if ( isset( $item->menu_item_parent ) && $item->menu_item_parent && isset( $_return[ $item->menu_item_parent ] ) ) {
74
+			if (isset($item->menu_item_parent) && $item->menu_item_parent && isset($_return[$item->menu_item_parent])) {
75 75
 
76
-				$_return[ $item->menu_item_parent ]->add_child( $item );
76
+				$_return[$item->menu_item_parent]->add_child($item);
77 77
 
78
-				unset( $_return[ $item_id ] );
78
+				unset($_return[$item_id]);
79 79
 
80 80
 			}
81 81
 		}
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	protected function get_first_menu_id() {
93 93
 
94
-		$menus = get_terms( 'nav_menu', array( 'hide_empty' => true ) );
94
+		$menus = get_terms('nav_menu', array('hide_empty' => true));
95 95
 
96
-		if ( is_array( $menus ) && count( $menus ) ) {
96
+		if (is_array($menus) && count($menus)) {
97 97
 
98
-			if ( isset( $menus[0]->term_id ) ) {
98
+			if (isset($menus[0]->term_id)) {
99 99
 
100 100
 				return $menus[0]->term_id;
101 101
 
@@ -112,15 +112,15 @@  discard block
 block discarded – undo
112 112
 	 * @param  int $menu_id
113 113
 	 * @return int/boolean
114 114
 	 */
115
-	protected function check_menu_id( $menu_id ) {
115
+	protected function check_menu_id($menu_id) {
116 116
 
117
-		$menus = get_terms( 'nav_menu', array( 'hide_empty' => true ) );
117
+		$menus = get_terms('nav_menu', array('hide_empty' => true));
118 118
 
119
-		if ( is_array( $menus ) && count( $menus ) ) {
119
+		if (is_array($menus) && count($menus)) {
120 120
 
121
-			foreach ( $menus as $menu ) {
121
+			foreach ($menus as $menu) {
122 122
 
123
-				if ( $menu->term_id == $menu_id ) {
123
+				if ($menu->term_id == $menu_id) {
124 124
 
125 125
 					return $menu_id;
126 126
 
@@ -138,17 +138,17 @@  discard block
 block discarded – undo
138 138
 	 * @param  string $slug
139 139
 	 * @return int
140 140
 	 */
141
-	protected function get_menu_id_by_name( $slug = null ) {
141
+	protected function get_menu_id_by_name($slug = null) {
142 142
 
143
-		if ( $slug && is_string( $slug ) ) {
143
+		if ($slug && is_string($slug)) {
144 144
 
145
-			$menu_id = get_term_by( 'slug', $slug, 'nav_menu' );
145
+			$menu_id = get_term_by('slug', $slug, 'nav_menu');
146 146
 
147
-			if ( $menu_id ) { return $menu_id; }
147
+			if ($menu_id) { return $menu_id; }
148 148
 
149
-			$menu_id = get_term_by( 'name', $slug, 'nav_menu' );
149
+			$menu_id = get_term_by('name', $slug, 'nav_menu');
150 150
 
151
-			if ( $menu_id ) { return $menu_id; }
151
+			if ($menu_id) { return $menu_id; }
152 152
 		}
153 153
 
154 154
 		return false;
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,8 @@
 block discarded – undo
29 29
 
30 30
 			$menu_id = $this->check_menu_id( $arg );
31 31
 
32
-		} elseif ( is_string( $arg ) ) {
32
+		}
33
+		elseif ( is_string( $arg ) ) {
33 34
 
34 35
 			$menu_id = $this->get_menu_id_by_name( $arg );
35 36
 
Please login to merge, or discard this patch.
app/classy/classy-menu-item.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @param WP_Post $item
43 43
 	 */
44
-	public function __construct( $item ) {
44
+	public function __construct($item) {
45 45
 
46
-		if ( is_a( $item, 'WP_Post' ) ) {
46
+		if (is_a($item, 'WP_Post')) {
47 47
 
48
-			$this->import( $item );
48
+			$this->import($item);
49 49
 			$this->filter_classes();
50 50
 
51 51
 		}
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function get_classes() {
104 104
 
105
-		return implode( ' ', $this->classes );
105
+		return implode(' ', $this->classes);
106 106
 
107 107
 	}
108 108
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 *
112 112
 	 * @param string $class_name
113 113
 	 */
114
-	public function add_class( $class_name ) {
114
+	public function add_class($class_name) {
115 115
 
116 116
 		$this->classes[] = $class_name;
117 117
 
@@ -122,17 +122,17 @@  discard block
 block discarded – undo
122 122
 	 *
123 123
 	 * @param ClassyMenuItem $item
124 124
 	 */
125
-	public function add_child( $item ) {
125
+	public function add_child($item) {
126 126
 
127
-		if ( ! $this->has_child ) {
128
-			$this->add_class( 'menu-item-has-children' );
127
+		if (!$this->has_child) {
128
+			$this->add_class('menu-item-has-children');
129 129
 			$this->has_child = true;
130 130
 		}
131 131
 
132 132
 		$this->children[] = $item;
133 133
 		$item->level = $this->level + 1;
134 134
 
135
-		if ( $item->children ) {
135
+		if ($item->children) {
136 136
 			$this->update_child_levels();
137 137
 		}
138 138
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	 */
146 146
 	protected function filter_classes() {
147 147
 
148
-		$this->classes = apply_filters( 'nav_menu_css_class', $this->classes, $this );
148
+		$this->classes = apply_filters('nav_menu_css_class', $this->classes, $this);
149 149
 
150 150
 	}
151 151
 
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	protected function update_child_levels() {
158 158
 
159
-		if ( is_array( $this->children ) ) {
159
+		if (is_array($this->children)) {
160 160
 
161
-			foreach ( $this->children as $child ) {
161
+			foreach ($this->children as $child) {
162 162
 				$child->level = $this->level + 1;
163 163
 				$child->update_child_levels();
164 164
 			}
Please login to merge, or discard this patch.
comments.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,6 +2,6 @@
 block discarded – undo
2 2
 
3 3
 global $post;
4 4
 
5
-$classypost = new ClassyPost( $post );
5
+$classypost = new ClassyPost($post);
6 6
 
7
-Classy::render( 'layout.comments', array( 'post' => $classypost ) );
7
+Classy::render('layout.comments', array('post' => $classypost));
Please login to merge, or discard this patch.
header.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php Classy::render( 'layout.header' ); ?>
2 1
\ No newline at end of file
2
+<?php Classy::render('layout.header'); ?>
3 3
\ No newline at end of file
Please login to merge, or discard this patch.
app/models/classy-image.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 	 * Main constructor function. Requires image id
13 13
 	 * @param int $pid
14 14
 	 */
15
-	public function __construct( $pid = null ) {
15
+	public function __construct($pid = null) {
16 16
 
17 17
 		// Checks if image with this id exists
18
-		if ( $pid && wp_get_attachment_image_src( $pid ) ) {
18
+		if ($pid && wp_get_attachment_image_src($pid)) {
19 19
 
20 20
 			$this->ID = $pid;
21 21
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	public static function get_default_image() {
34 34
 
35 35
 		// You can put here any url
36
-		return THEME_DIR . '/assets/noimage.png';
36
+		return THEME_DIR.'/assets/noimage.png';
37 37
 
38 38
 	}
39 39
 
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 	 * @param  string $size
43 43
 	 * @return string
44 44
 	 */
45
-	public function src( $size = 'medium' ) {
45
+	public function src($size = 'medium') {
46 46
 
47
-		if ( $this->ID ) {
47
+		if ($this->ID) {
48 48
 
49
-			$thumb = wp_get_attachment_image_src( $this->ID, $size );
49
+			$thumb = wp_get_attachment_image_src($this->ID, $size);
50 50
 
51 51
 			return $thumb[0];
52 52
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@  discard block
 block discarded – undo
19 19
 
20 20
 			$this->ID = $pid;
21 21
 
22
-		} else {
22
+		}
23
+		else {
23 24
 
24 25
 			$this->ID = 0;
25 26
 
@@ -50,7 +51,8 @@  discard block
 block discarded – undo
50 51
 
51 52
 			return $thumb[0];
52 53
 
53
-		} else {
54
+		}
55
+		else {
54 56
 
55 57
 			return self::get_default_image();
56 58
 
Please login to merge, or discard this patch.