Completed
Push — master ( 854e15...fefbc6 )
by Andrew
04:57 queued 02:25
created
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.
app/models/classy-image.php 2 patches
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.
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 ( null !== $pid && wp_get_attachment_image_src( $pid ) ) {
18
+		if (null !== $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 CLASSY_THEME_DIR . '/assets/noimage.png';
36
+		return CLASSY_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.
app/classy/classy-hierarchy.php 3 patches
Doc Comments   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -131,7 +131,8 @@  discard block
 block discarded – undo
131 131
 	 *
132 132
 	 * @param  string $type view|scope
133 133
 	 * @param  string $type
134
-	 * @return array
134
+	 * @param string $page
135
+	 * @return string|false
135 136
 	 */
136 137
 	public static function get_available_file( $type = 'view', $page ) {
137 138
 
@@ -374,7 +375,7 @@  discard block
 block discarded – undo
374 375
 	/**
375 376
 	 * Returns classy template name or boolean if this is not classy template
376 377
 	 *
377
-	 * @return mixed
378
+	 * @return string|false
378 379
 	 */
379 380
 	public static function get_classy_template() {
380 381
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,9 +54,11 @@  discard block
 block discarded – undo
54 54
 
55 55
 		elseif ( is_paged() ) : return 'paged';
56 56
 
57
-		else :
57
+		else {
58
+			:
58 59
 
59 60
 			return 'index';
61
+		}
60 62
 
61 63
 		endif;
62 64
 
@@ -97,7 +99,8 @@  discard block
 block discarded – undo
97 99
 
98 100
 			return THEME_PATH . $folder . '/' . $view . '.blade.php';
99 101
 
100
-		} elseif ( 'scope' === $type ) {
102
+		}
103
+		elseif ( 'scope' === $type ) {
101 104
 
102 105
 			$folder = ClassyScope::$folder;
103 106
 
@@ -234,7 +237,8 @@  discard block
 block discarded – undo
234 237
 
235 238
 					list( $type, $subtype ) = explode( '/', $attachment->post_mime_type );
236 239
 
237
-				} else {
240
+				}
241
+				else {
238 242
 
239 243
 					list( $type, $subtype ) = array( $attachment->post_mime_type, '' );
240 244
 
@@ -347,9 +351,11 @@  discard block
 block discarded – undo
347 351
 
348 352
 			// Default
349 353
 
350
-		else :
354
+		else {
355
+			:
351 356
 
352 357
 			$views[] = $type;
358
+		}
353 359
 
354 360
 		endif;
355 361
 
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -20,39 +20,39 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	protected static function check_request() {
22 22
 
23
-		if ( is_404() ) : return '404';
23
+		if (is_404()) : return '404';
24 24
 
25
-		elseif ( is_search() ) : return 'search';
25
+		elseif (is_search()) : return 'search';
26 26
 
27
-		elseif ( is_front_page() ) : return 'front-page';
27
+		elseif (is_front_page()) : return 'front-page';
28 28
 
29
-		elseif ( is_home() ) : return 'home';
29
+		elseif (is_home()) : return 'home';
30 30
 
31
-		elseif ( is_post_type_archive() ) : return 'post_type_archive';
31
+		elseif (is_post_type_archive()) : return 'post_type_archive';
32 32
 
33
-		elseif ( is_tax() ) : return 'taxonomy';
33
+		elseif (is_tax()) : return 'taxonomy';
34 34
 
35
-		elseif ( is_attachment() ) : return 'attachment';
35
+		elseif (is_attachment()) : return 'attachment';
36 36
 
37
-		elseif ( is_single() ) : return 'single';
37
+		elseif (is_single()) : return 'single';
38 38
 
39
-		elseif ( self::is_classy_template() ) : return 'classy-template';
39
+		elseif (self::is_classy_template()) : return 'classy-template';
40 40
 
41
-		elseif ( is_page() ) : return 'page';
41
+		elseif (is_page()) : return 'page';
42 42
 
43
-		elseif ( is_singular() ) : return 'singular';
43
+		elseif (is_singular()) : return 'singular';
44 44
 
45
-		elseif ( is_category() ) : return 'category';
45
+		elseif (is_category()) : return 'category';
46 46
 
47
-		elseif ( is_tag() ) : return 'tag';
47
+		elseif (is_tag()) : return 'tag';
48 48
 
49
-		elseif ( is_author() ) : return 'author';
49
+		elseif (is_author()) : return 'author';
50 50
 
51
-		elseif ( is_date() ) : return 'date';
51
+		elseif (is_date()) : return 'date';
52 52
 
53
-		elseif ( is_archive() ) : return 'archive';
53
+		elseif (is_archive()) : return 'archive';
54 54
 
55
-		elseif ( is_paged() ) : return 'paged';
55
+		elseif (is_paged()) : return 'paged';
56 56
 
57 57
 		else :
58 58
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	public static function get_current_request() {
71 71
 
72
-		if ( null === self::$current_request ) {
72
+		if (null === self::$current_request) {
73 73
 
74 74
 			self::$current_request = self::check_request();
75 75
 
@@ -87,21 +87,21 @@  discard block
 block discarded – undo
87 87
 	 * @param  string $view path to view ex: "post/archive"
88 88
 	 * @return string           full fule path
89 89
 	 */
90
-	public static function get_file_path( $type = 'view', $view ) {
90
+	public static function get_file_path($type = 'view', $view) {
91 91
 
92
-		$view = str_replace( '.', '/', $view );
92
+		$view = str_replace('.', '/', $view);
93 93
 
94
-		if ( 'view' === $type ) {
94
+		if ('view' === $type) {
95 95
 
96 96
 			$folder = ClassyView::$folder;
97 97
 
98
-			return CLASSY_THEME_PATH . $folder . '/' . $view . '.blade.php';
98
+			return CLASSY_THEME_PATH.$folder.'/'.$view.'.blade.php';
99 99
 
100
-		} elseif ( 'scope' === $type ) {
100
+		} elseif ('scope' === $type) {
101 101
 
102 102
 			$folder = ClassyScope::$folder;
103 103
 
104
-			return CLASSY_THEME_PATH . $folder . '/' . $view . '.php';
104
+			return CLASSY_THEME_PATH.$folder.'/'.$view.'.php';
105 105
 
106 106
 		}
107 107
 
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
 	 * @param  string $file in blade path format, ex: layout|header
116 116
 	 * @return boolean true|false
117 117
 	 */
118
-	public static function file_exists( $type = 'view', $file ) {
118
+	public static function file_exists($type = 'view', $file) {
119 119
 
120
-		$file = str_replace( '.', '/', $file );
120
+		$file = str_replace('.', '/', $file);
121 121
 
122
-		$file_path = self::get_file_path( $type, $file );
122
+		$file_path = self::get_file_path($type, $file);
123 123
 
124
-		return file_exists( $file_path );
124
+		return file_exists($file_path);
125 125
 
126 126
 	}
127 127
 
@@ -133,13 +133,13 @@  discard block
 block discarded – undo
133 133
 	 * @param  string $type
134 134
 	 * @return array
135 135
 	 */
136
-	public static function get_available_file( $type = 'view', $page ) {
136
+	public static function get_available_file($type = 'view', $page) {
137 137
 
138
-		$views = self::get_request_hierarchy_list( $page );
138
+		$views = self::get_request_hierarchy_list($page);
139 139
 
140
-		foreach ( $views as $view ) {
140
+		foreach ($views as $view) {
141 141
 
142
-			if ( self::file_exists( $type, $view ) ) :
142
+			if (self::file_exists($type, $view)) :
143 143
 
144 144
 				return $view;
145 145
 
@@ -158,43 +158,43 @@  discard block
 block discarded – undo
158 158
 	 * @param  string $type
159 159
 	 * @return array
160 160
 	 */
161
-	private static function get_request_hierarchy_list( $type ) {
161
+	private static function get_request_hierarchy_list($type) {
162 162
 
163 163
 		$views = array();
164 164
 
165 165
 		// Home
166 166
 
167
-		if ( 'home' === $type ) :
167
+		if ('home' === $type) :
168 168
 
169 169
 			$views[] = 'home';
170 170
 
171 171
 			// Single
172 172
 
173
-		elseif ( 'single' === $type ) :
173
+		elseif ('single' === $type) :
174 174
 
175 175
 			$post_type = get_post_type();
176 176
 
177
-			$views[] = $post_type . '.single';
177
+			$views[] = $post_type.'.single';
178 178
 
179 179
 			$views[] = 'single';
180 180
 
181 181
 			// Post type
182 182
 
183
-		elseif ( 'post_type_archive' === $type ) :
183
+		elseif ('post_type_archive' === $type) :
184 184
 
185 185
 			$post_type = get_post_type();
186 186
 
187
-			$views[] = $post_type . '.archive';
187
+			$views[] = $post_type.'.archive';
188 188
 
189 189
 			$views[] = 'archive';
190 190
 
191 191
 			// Taxonomy
192 192
 
193
-		elseif ( 'taxonomy' === $type ) :
193
+		elseif ('taxonomy' === $type) :
194 194
 
195 195
 			$term = get_queried_object();
196 196
 
197
-			if ( ! empty( $term->slug ) ) {
197
+			if (!empty($term->slug)) {
198 198
 
199 199
 				$taxonomy = $term->taxonomy;
200 200
 
@@ -209,11 +209,11 @@  discard block
 block discarded – undo
209 209
 
210 210
 			// Category
211 211
 
212
-		elseif ( 'category' === $type ) :
212
+		elseif ('category' === $type) :
213 213
 
214 214
 			$category = get_queried_object();
215 215
 
216
-			if ( ! empty( $category->slug ) ) {
216
+			if (!empty($category->slug)) {
217 217
 				$views[] = "category.{$category->slug}";
218 218
 				$views[] = "category.{$category->term_id}";
219 219
 			}
@@ -224,23 +224,23 @@  discard block
 block discarded – undo
224 224
 
225 225
 			// Attachment
226 226
 
227
-		elseif ( 'attachment' === $type ) :
227
+		elseif ('attachment' === $type) :
228 228
 
229 229
 			$attachment = get_queried_object();
230 230
 
231
-			if ( $attachment ) {
231
+			if ($attachment) {
232 232
 
233
-				if ( false !== strpos( $attachment->post_mime_type, '/' ) ) {
233
+				if (false !== strpos($attachment->post_mime_type, '/')) {
234 234
 
235
-					list( $type, $subtype ) = explode( '/', $attachment->post_mime_type );
235
+					list($type, $subtype) = explode('/', $attachment->post_mime_type);
236 236
 
237 237
 				} else {
238 238
 
239
-					list( $type, $subtype ) = array( $attachment->post_mime_type, '' );
239
+					list($type, $subtype) = array($attachment->post_mime_type, '');
240 240
 
241 241
 				}
242 242
 
243
-				if ( ! empty( $subtype ) ) {
243
+				if (!empty($subtype)) {
244 244
 					$views[] = "attachment.{$type}.{$subtype}";
245 245
 					$views[] = "attachment.{$subtype}";
246 246
 
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
 
260 260
 			// Tag
261 261
 
262
-		elseif ( 'tag' === $type ) :
262
+		elseif ('tag' === $type) :
263 263
 
264 264
 			$tag = get_queried_object();
265 265
 
266
-			if ( ! empty( $tag->slug ) ) {
266
+			if (!empty($tag->slug)) {
267 267
 				$views[] = "post.tag.{$tag->slug}";
268 268
 				$views[] = "post.tag.{$tag->term_id}";
269 269
 
@@ -276,11 +276,11 @@  discard block
 block discarded – undo
276 276
 
277 277
 			// Author
278 278
 
279
-		elseif ( 'author' === $type ) :
279
+		elseif ('author' === $type) :
280 280
 
281 281
 			$author = get_queried_object();
282 282
 
283
-			if ( $author instanceof WP_User ) {
283
+			if ($author instanceof WP_User) {
284 284
 				$views[] = "post.author.{$author->user_nicename}";
285 285
 				$views[] = "post.author.{$author->ID}";
286 286
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 
295 295
 			// Front Page
296 296
 
297
-		elseif ( 'front-page' === $type ) :
297
+		elseif ('front-page' === $type) :
298 298
 
299 299
 			$views[] = 'front-page.front-page';
300 300
 			$views[] = 'front-page';
@@ -302,45 +302,45 @@  discard block
 block discarded – undo
302 302
 			$views[] = 'home.home';
303 303
 			$views[] = 'home';
304 304
 
305
-			$views = array_merge( $views, self::get_request_hierarchy_list( 'post_type_archive' ) );
305
+			$views = array_merge($views, self::get_request_hierarchy_list('post_type_archive'));
306 306
 
307 307
 			// Page
308 308
 
309
-		elseif ( 'classy-template' === $type ) :
309
+		elseif ('classy-template' === $type) :
310 310
 
311 311
 			$template = self::get_classy_template();
312 312
 
313 313
 			$views[] = $template;
314 314
 
315
-			$views[] = 'page.' . $template;
315
+			$views[] = 'page.'.$template;
316 316
 
317
-			$views[] = 'template.' . $template;
317
+			$views[] = 'template.'.$template;
318 318
 
319 319
 			$views[] = 'page.page';
320 320
 
321 321
 			$views[] = 'page';
322 322
 
323
-		elseif ( 'page' === $type ) :
323
+		elseif ('page' === $type) :
324 324
 
325 325
 			$id = get_queried_object_id();
326 326
 
327
-			$pagename = get_query_var( 'pagename' );
327
+			$pagename = get_query_var('pagename');
328 328
 
329
-			if ( ! $pagename && $id ) {
329
+			if (!$pagename && $id) {
330 330
 				// If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
331 331
 				$post = get_queried_object();
332 332
 
333
-				if ( $post ) {
333
+				if ($post) {
334 334
 					$pagename = $post->post_name;
335 335
 				}
336 336
 			}
337 337
 
338
-			if ( $pagename ) {
339
-				$views[] = 'page.' . $pagename;
338
+			if ($pagename) {
339
+				$views[] = 'page.'.$pagename;
340 340
 			}
341 341
 
342
-			if ( $id ) {
343
-				$views[] = 'page.' . $id;
342
+			if ($id) {
343
+				$views[] = 'page.'.$id;
344 344
 			}
345 345
 
346 346
 			$views[] = 'page.page';
@@ -382,9 +382,9 @@  discard block
 block discarded – undo
382 382
 
383 383
 		$template_slug = get_page_template_slug();
384 384
 
385
-		preg_match( '/classy\-(.*)/', $template_slug, $matches );
385
+		preg_match('/classy\-(.*)/', $template_slug, $matches);
386 386
 
387
-		if ( ! empty( $matches ) && isset( $matches[1] ) ) { return $matches[1]; }
387
+		if (!empty($matches) && isset($matches[1])) { return $matches[1]; }
388 388
 
389 389
 		return false;
390 390
 
Please login to merge, or discard this patch.
app/classy/classy.php 3 patches
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -229,12 +229,14 @@  discard block
 block discarded – undo
229 229
 
230 230
 				$scope = array_merge( $common_scope, $data );
231 231
 
232
-			} else {
232
+			}
233
+			else {
233 234
 
234 235
 				$scope = $common_scope;
235 236
 
236 237
 			}
237
-		} else {
238
+		}
239
+		else {
238 240
 
239 241
 			$view = ClassyView::get_view();
240 242
 
@@ -283,11 +285,13 @@  discard block
 block discarded – undo
283 285
 
284 286
 					$_return[] = $post->id;
285 287
 
286
-				} elseif ( 'object' === $return ) {
288
+				}
289
+				elseif ( 'object' === $return ) {
287 290
 
288 291
 					$_return[] = $post;
289 292
 
290
-				} elseif ( class_exists( $return ) ) {
293
+				}
294
+				elseif ( class_exists( $return ) ) {
291 295
 
292 296
 					$_return[] = new $return( $post );
293 297
 
@@ -341,7 +345,8 @@  discard block
 block discarded – undo
341 345
 			$args['format'] = 'page/%#%';
342 346
 			$args['base'] = trailingslashit( $url[0] ).'%_%';
343 347
 
344
-		} else {
348
+		}
349
+		else {
345 350
 			$big = 999999999;
346 351
 			$args['base'] = str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) );
347 352
 		}
@@ -353,7 +358,8 @@  discard block
 block discarded – undo
353 358
 
354 359
 		if ( is_int( $prefs ) ) {
355 360
 			$args['mid_size'] = $prefs - 2;
356
-		} else {
361
+		}
362
+		else {
357 363
 			$args = array_merge( $args, $prefs );
358 364
 		}
359 365
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -302,7 +302,7 @@
 block discarded – undo
302 302
 
303 303
 	/**
304 304
 	 * @param array   $prefs
305
-	 * @return array mixed
305
+	 * @return stdClass mixed
306 306
 	 */
307 307
 	public static function get_pagination( $prefs = array() ) {
308 308
 
Please login to merge, or discard this patch.
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public static function get_instance() {
31 31
 
32
-		if ( null === self::$single_instance ) {
32
+		if (null === self::$single_instance) {
33 33
 
34 34
 			self::$single_instance = new self();
35 35
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 		$this->init_config();
58 58
 
59
-		add_filter( 'theme_page_templates', array( $this, 'filter_templates' ) );
59
+		add_filter('theme_page_templates', array($this, 'filter_templates'));
60 60
 
61 61
 	}
62 62
 
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 
71 71
 		$theme = wp_get_theme();
72 72
 
73
-		define( 'CLASSY_THEME', $theme->template );
74
-		define( 'CLASSY_THEME_NAME', $theme->get( 'Name' ) );
75
-		define( 'CLASSY_THEME_PATH', get_template_directory() . '/' );
76
-		define( 'CLASSY_THEME_DIR', get_template_directory_uri() . '/' );
77
-		define( 'CLASSY_THEME_VERSION', $theme->get( 'Version' ) );
78
-		define( 'CLASSY_THEME_FRAMEWORK_PATH', CLASSY_THEME_PATH . 'app/' );
79
-		define( 'CLASSY_THEME_FRAMEWORK_DIR', CLASSY_THEME_DIR . 'app/' );
73
+		define('CLASSY_THEME', $theme->template);
74
+		define('CLASSY_THEME_NAME', $theme->get('Name'));
75
+		define('CLASSY_THEME_PATH', get_template_directory().'/');
76
+		define('CLASSY_THEME_DIR', get_template_directory_uri().'/');
77
+		define('CLASSY_THEME_VERSION', $theme->get('Version'));
78
+		define('CLASSY_THEME_FRAMEWORK_PATH', CLASSY_THEME_PATH.'app/');
79
+		define('CLASSY_THEME_FRAMEWORK_DIR', CLASSY_THEME_DIR.'app/');
80 80
 
81 81
 	}
82 82
 
@@ -85,40 +85,40 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	private function include_core_files() {
87 87
 
88
-		require_once CLASSY_THEME_PATH . 'vendor/autoload.php';
88
+		require_once CLASSY_THEME_PATH.'vendor/autoload.php';
89 89
 
90 90
 		// Basis Class
91
-		require_once CLASSY_THEME_FRAMEWORK_PATH . 'classy/classy-basis.php';
91
+		require_once CLASSY_THEME_FRAMEWORK_PATH.'classy/classy-basis.php';
92 92
 
93 93
 		// Hierarchy
94
-		require_once CLASSY_THEME_FRAMEWORK_PATH . 'classy/classy-hierarchy.php';
94
+		require_once CLASSY_THEME_FRAMEWORK_PATH.'classy/classy-hierarchy.php';
95 95
 
96 96
 		// Theme Config
97
-		require_once CLASSY_THEME_FRAMEWORK_PATH . 'classy/classy-config.php';
97
+		require_once CLASSY_THEME_FRAMEWORK_PATH.'classy/classy-config.php';
98 98
 
99 99
 		// Scope
100
-		require_once CLASSY_THEME_FRAMEWORK_PATH . 'classy/classy-scope.php';
100
+		require_once CLASSY_THEME_FRAMEWORK_PATH.'classy/classy-scope.php';
101 101
 
102 102
 		// View Loader
103
-		require_once CLASSY_THEME_FRAMEWORK_PATH . 'classy/classy-view.php';
103
+		require_once CLASSY_THEME_FRAMEWORK_PATH.'classy/classy-view.php';
104 104
 
105 105
 		// Helper functions
106
-		require_once CLASSY_THEME_FRAMEWORK_PATH . 'classy/classy-helper.php';
106
+		require_once CLASSY_THEME_FRAMEWORK_PATH.'classy/classy-helper.php';
107 107
 
108 108
 		// Query Helper
109
-		require_once CLASSY_THEME_FRAMEWORK_PATH . 'classy/classy-query-helper.php';
109
+		require_once CLASSY_THEME_FRAMEWORK_PATH.'classy/classy-query-helper.php';
110 110
 
111 111
 		// Menu
112
-		require_once CLASSY_THEME_FRAMEWORK_PATH . 'classy/classy-menu.php';
112
+		require_once CLASSY_THEME_FRAMEWORK_PATH.'classy/classy-menu.php';
113 113
 
114 114
 		// Menu Item
115
-		require_once CLASSY_THEME_FRAMEWORK_PATH . 'classy/classy-menu-item.php';
115
+		require_once CLASSY_THEME_FRAMEWORK_PATH.'classy/classy-menu-item.php';
116 116
 
117 117
 		// Comment
118
-		require_once CLASSY_THEME_FRAMEWORK_PATH . 'classy/classy-comment.php';
118
+		require_once CLASSY_THEME_FRAMEWORK_PATH.'classy/classy-comment.php';
119 119
 
120 120
 		// Appearance
121
-		require_once CLASSY_THEME_FRAMEWORK_PATH . 'appearance.php';
121
+		require_once CLASSY_THEME_FRAMEWORK_PATH.'appearance.php';
122 122
 
123 123
 	}
124 124
 
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	private function include_models() {
129 129
 
130
-		$files = (array) glob( CLASSY_THEME_FRAMEWORK_PATH . '/models/*.php' );
130
+		$files = (array) glob(CLASSY_THEME_FRAMEWORK_PATH.'/models/*.php');
131 131
 
132
-		foreach ( $files as $filename ) {
132
+		foreach ($files as $filename) {
133 133
 
134
-			if ( ! empty( $filename ) ) {
134
+			if (!empty($filename)) {
135 135
 
136 136
 				require_once $filename;
137 137
 
@@ -156,11 +156,11 @@  discard block
 block discarded – undo
156 156
 	 *
157 157
 	 * @return array
158 158
 	 */
159
-	public function filter_templates( $page_templates = array() ) {
159
+	public function filter_templates($page_templates = array()) {
160 160
 
161 161
 		$custom_templates = ClassyView::get_page_templates_list();
162 162
 
163
-		return array_merge( $page_templates, $custom_templates );
163
+		return array_merge($page_templates, $custom_templates);
164 164
 
165 165
 	}
166 166
 
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
 	 *
172 172
 	 * @return mixed|bool Return false if variable not found.
173 173
 	 */
174
-	public static function get_config_var( $name ) {
174
+	public static function get_config_var($name) {
175 175
 
176 176
 		$vars = ClassyConfig::get_vars();
177 177
 
178
-		return ( isset( $vars[ $name ] ) ) ? $vars[ $name ] : false;
178
+		return (isset($vars[$name])) ? $vars[$name] : false;
179 179
 
180 180
 	}
181 181
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	 */
187 187
 	public static function textdomain() {
188 188
 
189
-		$textdomain = Classy::get_config_var( 'textdomain' );
189
+		$textdomain = Classy::get_config_var('textdomain');
190 190
 
191 191
 		return $textdomain ? $textdomain : CLASSY_THEME;
192 192
 
@@ -201,17 +201,17 @@  discard block
 block discarded – undo
201 201
 	 * @param  array|null  $data     Additional params
202 202
 	 * @return void
203 203
 	 */
204
-	public static function render( $view = null, $data = null ) {
204
+	public static function render($view = null, $data = null) {
205 205
 
206
-		$views = CLASSY_THEME_PATH . ClassyView::$folder;
207
-		$cache = WP_CONTENT_DIR . '/viewcache';
206
+		$views = CLASSY_THEME_PATH.ClassyView::$folder;
207
+		$cache = WP_CONTENT_DIR.'/viewcache';
208 208
 		$common_scope = ClassyScope::get_common_scope();
209 209
 
210
-		if ( null !== $view && is_string( $view ) ) {
210
+		if (null !== $view && is_string($view)) {
211 211
 
212
-			if ( $data && is_array( $data ) ) {
212
+			if ($data && is_array($data)) {
213 213
 
214
-				$scope = array_merge( $common_scope, $data );
214
+				$scope = array_merge($common_scope, $data);
215 215
 
216 216
 			} else {
217 217
 
@@ -226,9 +226,9 @@  discard block
 block discarded – undo
226 226
 
227 227
 		}
228 228
 
229
-		$renderer = new BladeRenderer( $views, array( 'cache_path' => $cache ) );
229
+		$renderer = new BladeRenderer($views, array('cache_path' => $cache));
230 230
 
231
-		echo $renderer->render( $view, $scope ); // XSS: xss ok.
231
+		echo $renderer->render($view, $scope); // XSS: xss ok.
232 232
 
233 233
 	}
234 234
 
@@ -253,27 +253,27 @@  discard block
 block discarded – undo
253 253
 	 * @param  string  $return object/id/ClassyPost
254 254
 	 * @return mixed
255 255
 	 */
256
-	public static function get_posts( $args = false, $return = 'ClassyPost' ) {
256
+	public static function get_posts($args = false, $return = 'ClassyPost') {
257 257
 
258 258
 		$_return = array();
259 259
 
260
-		$query = ClassyQueryHelper::find_query( $args );
260
+		$query = ClassyQueryHelper::find_query($args);
261 261
 
262
-		if ( isset( $query->posts ) ) {
262
+		if (isset($query->posts)) {
263 263
 
264
-			foreach ( $query->posts as $post ) {
264
+			foreach ($query->posts as $post) {
265 265
 
266
-				if ( 'id' === $return ) {
266
+				if ('id' === $return) {
267 267
 
268 268
 					$_return[] = $post->id;
269 269
 
270
-				} elseif ( 'object' === $return ) {
270
+				} elseif ('object' === $return) {
271 271
 
272 272
 					$_return[] = $post;
273 273
 
274
-				} elseif ( class_exists( $return ) ) {
274
+				} elseif (class_exists($return)) {
275 275
 
276
-					$_return[] = new $return( $post );
276
+					$_return[] = new $return($post);
277 277
 
278 278
 				}
279 279
 			}
@@ -290,11 +290,11 @@  discard block
 block discarded – undo
290 290
 	 * @param  string  $return_type ClassyPost/object/id
291 291
 	 * @return mixed
292 292
 	 */
293
-	public static function get_post( $args = false, $return_type = 'ClassyPost' ) {
293
+	public static function get_post($args = false, $return_type = 'ClassyPost') {
294 294
 
295
-		$posts = self::get_posts( $args, $return_type );
295
+		$posts = self::get_posts($args, $return_type);
296 296
 
297
-		if ( $post = reset( $posts ) ) {
297
+		if ($post = reset($posts)) {
298 298
 			return $post;
299 299
 		}
300 300
 
@@ -304,62 +304,62 @@  discard block
 block discarded – undo
304 304
 	 * @param array   $prefs
305 305
 	 * @return array mixed
306 306
 	 */
307
-	public static function get_pagination( $prefs = array() ) {
307
+	public static function get_pagination($prefs = array()) {
308 308
 
309 309
 		global $wp_query;
310 310
 		global $paged;
311 311
 		global $wp_rewrite;
312 312
 
313 313
 		$args = array();
314
-		$args['total'] = ceil( $wp_query->found_posts / $wp_query->query_vars['posts_per_page'] );
314
+		$args['total'] = ceil($wp_query->found_posts / $wp_query->query_vars['posts_per_page']);
315 315
 
316
-		if ( $wp_rewrite->using_permalinks() ) {
316
+		if ($wp_rewrite->using_permalinks()) {
317 317
 
318
-			$url = explode( '?', get_pagenum_link( 0 ) );
318
+			$url = explode('?', get_pagenum_link(0));
319 319
 
320
-			if ( isset( $url[1] ) ) {
321
-				parse_str( $url[1], $query );
320
+			if (isset($url[1])) {
321
+				parse_str($url[1], $query);
322 322
 				$args['add_args'] = $query;
323 323
 			}
324 324
 
325 325
 			$args['format'] = 'page/%#%';
326
-			$args['base'] = trailingslashit( $url[0] ).'%_%';
326
+			$args['base'] = trailingslashit($url[0]).'%_%';
327 327
 
328 328
 		} else {
329 329
 			$big = 999999999;
330
-			$args['base'] = str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) );
330
+			$args['base'] = str_replace($big, '%#%', esc_url(get_pagenum_link($big)));
331 331
 		}
332 332
 
333 333
 		$args['type'] = 'array';
334
-		$args['current'] = max( 1, get_query_var( 'paged' ) );
335
-		$args['mid_size'] = max( 9 - $args['current'], 3 );
334
+		$args['current'] = max(1, get_query_var('paged'));
335
+		$args['mid_size'] = max(9 - $args['current'], 3);
336 336
 		$args['prev_next'] = false;
337 337
 
338
-		if ( is_int( $prefs ) ) {
338
+		if (is_int($prefs)) {
339 339
 			$args['mid_size'] = $prefs - 2;
340 340
 		} else {
341
-			$args = array_merge( $args, $prefs );
341
+			$args = array_merge($args, $prefs);
342 342
 		}
343 343
 
344 344
 		$data = array();
345
-		$data['pages'] = ClassyHelper::paginate_links( $args );
346
-		$next = get_next_posts_page_link( $args['total'] );
345
+		$data['pages'] = ClassyHelper::paginate_links($args);
346
+		$next = get_next_posts_page_link($args['total']);
347 347
 
348
-		if ( $next ) {
349
-			$data['next'] = array( 'link' => untrailingslashit( $next ), 'class' => 'page-numbers next' );
348
+		if ($next) {
349
+			$data['next'] = array('link' => untrailingslashit($next), 'class' => 'page-numbers next');
350 350
 		}
351 351
 
352
-		$prev = previous_posts( false );
352
+		$prev = previous_posts(false);
353 353
 
354
-		if ( $prev ) {
355
-			$data['prev'] = array( 'link' => untrailingslashit( $prev ), 'class' => 'page-numbers prev' );
354
+		if ($prev) {
355
+			$data['prev'] = array('link' => untrailingslashit($prev), 'class' => 'page-numbers prev');
356 356
 		}
357 357
 
358
-		if ( $paged < 2 ) {
358
+		if ($paged < 2) {
359 359
 			$data['prev'] = null;
360 360
 		}
361 361
 
362
-		return ClassyHelper::array_to_object( $data );
362
+		return ClassyHelper::array_to_object($data);
363 363
 
364 364
 	}
365 365
 }
Please login to merge, or discard this patch.
footer.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.footer' );
2 1
\ No newline at end of file
2
+<?php Classy::render('layout.footer');
3 3
\ No newline at end of file
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-user.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 	 *
67 67
 	 * @param int $uid User id.
68 68
 	 */
69
-	public function __construct( $uid = null ) {
70
-		$this->ID = $this->verify_id( $uid );
69
+	public function __construct($uid = null) {
70
+		$this->ID = $this->verify_id($uid);
71 71
 
72 72
 		$this->init();
73 73
 	}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 *
80 80
 	 * @return int
81 81
 	 */
82
-	private function verify_id( $uid ) {
82
+	private function verify_id($uid) {
83 83
 		// @todo: Realize this method.
84 84
 		return $uid;
85 85
 	}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	private function init() {
91 91
 		$this->object = $this->get_object();
92 92
 
93
-		$this->import( $this->object );
93
+		$this->import($this->object);
94 94
 
95 95
 		$this->setup_user_name();
96 96
 	}
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 * @return object
102 102
 	 */
103 103
 	private function get_object() {
104
-		return get_user_by( 'id', $this->ID );
104
+		return get_user_by('id', $this->ID);
105 105
 	}
106 106
 
107 107
 	/**
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
 	 * @return string
156 156
 	 */
157 157
 	public function link() {
158
-		if ( ! $this->link ) {
159
-			$this->link = get_author_posts_url( $this->ID );
158
+		if (!$this->link) {
159
+			$this->link = get_author_posts_url($this->ID);
160 160
 		}
161 161
 
162 162
 		return $this->link;
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 	 */
168 168
 	private function setup_user_name() {
169 169
 		$this->name = 'Anonymous';
170
-		if ( isset( $this->object->first_name ) && isset( $this->object->last_name ) ) {
171
-			$this->name = $this->object->first_name . ' ' . $this->object->last_name;
170
+		if (isset($this->object->first_name) && isset($this->object->last_name)) {
171
+			$this->name = $this->object->first_name.' '.$this->object->last_name;
172 172
 		}
173 173
 
174 174
 		$this->display_name = $this->object->display_name;
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( CLASSY_THEME_PATH . '/' . self::$folder . '/*/*.blade.php' );
57
+		$files = (array) glob(CLASSY_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.