Completed
Pull Request — master (#7)
by
unknown
03:02
created
app/classy/classy.php 2 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,6 +54,7 @@  discard block
 block discarded – undo
54 54
 	 * 
55 55
 	 * @param  string
56 56
 	 * @param  string
57
+	 * @param string $name
57 58
 	 */
58 59
 	private function define( $name, $value ) {
59 60
 		if ( !defined($name) ) {
@@ -241,7 +242,7 @@  discard block
 block discarded – undo
241 242
 
242 243
 	/**
243 244
 	 * @param array   $prefs
244
-	 * @return array mixed
245
+	 * @return stdClass mixed
245 246
 	 */
246 247
 	public static function get_pagination( $prefs = array() ) {
247 248
 		global $wp_query;
Please login to merge, or discard this patch.
Spacing   +72 added lines, -72 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
 
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
 	 * @param  string
67 67
 	 * @param  string
68 68
 	 */
69
-	private function define( $name, $value ) {
69
+	private function define($name, $value) {
70 70
 
71
-		if ( ! defined( $name ) ) {
71
+		if (!defined($name)) {
72 72
 
73
-			define( $name, $value );
73
+			define($name, $value);
74 74
 
75 75
 		}
76 76
 
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 
87 87
 		$theme = wp_get_theme();
88 88
 
89
-		$this->define( 'THEME', $theme->template );
90
-		$this->define( 'THEME_NAME', $theme->get( 'Name' ) );
91
-		$this->define( 'THEME_PATH', get_template_directory() . '/' );
92
-		$this->define( 'THEME_DIR', get_template_directory_uri() . '/' );
93
-		$this->define( 'THEME_VERSION', $theme->get( 'Version' ) );
94
-		$this->define( 'THEME_FRAMEWORK_PATH', THEME_PATH . 'app/' );
95
-		$this->define( 'THEME_FRAMEWORK_DIR', THEME_DIR . 'app/' );
89
+		$this->define('THEME', $theme->template);
90
+		$this->define('THEME_NAME', $theme->get('Name'));
91
+		$this->define('THEME_PATH', get_template_directory().'/');
92
+		$this->define('THEME_DIR', get_template_directory_uri().'/');
93
+		$this->define('THEME_VERSION', $theme->get('Version'));
94
+		$this->define('THEME_FRAMEWORK_PATH', THEME_PATH.'app/');
95
+		$this->define('THEME_FRAMEWORK_DIR', THEME_DIR.'app/');
96 96
 
97 97
 	}
98 98
 
@@ -101,40 +101,40 @@  discard block
 block discarded – undo
101 101
 	 */
102 102
 	private function include_core_files() {
103 103
 
104
-		require_once THEME_PATH . 'vendor/autoload.php';
104
+		require_once THEME_PATH.'vendor/autoload.php';
105 105
 
106 106
 		// Basis Class
107
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-basis.php';
107
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-basis.php';
108 108
 
109 109
 		// Hierarchy
110
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-hierarchy.php';
110
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-hierarchy.php';
111 111
 
112 112
 		// Theme Config
113
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-config.php';
113
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-config.php';
114 114
 
115 115
 		// Scope
116
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-scope.php';
116
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-scope.php';
117 117
 
118 118
 		// View Loader
119
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-view.php';
119
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-view.php';
120 120
 
121 121
 		// Helper functions
122
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-helper.php';
122
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-helper.php';
123 123
 
124 124
 		// Query Helper
125
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-query-helper.php';
125
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-query-helper.php';
126 126
 
127 127
 		// Menu
128
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-menu.php';
128
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-menu.php';
129 129
 
130 130
 		// Menu Item
131
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-menu-item.php';
131
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-menu-item.php';
132 132
 
133 133
 		// Comment
134
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-comment.php';
134
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-comment.php';
135 135
 
136 136
 		// Appearance
137
-		require_once THEME_FRAMEWORK_PATH . 'appearance.php';
137
+		require_once THEME_FRAMEWORK_PATH.'appearance.php';
138 138
 
139 139
 	}
140 140
 
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	private function include_models() {
145 145
 
146
-		$files = (array) glob( THEME_FRAMEWORK_PATH . '/models/*.php' );
146
+		$files = (array) glob(THEME_FRAMEWORK_PATH.'/models/*.php');
147 147
 
148
-		foreach ( $files as $filename ) {
148
+		foreach ($files as $filename) {
149 149
 
150
-			if ( ! empty( $filename ) ) {
150
+			if (!empty($filename)) {
151 151
 
152 152
 				require_once $filename;
153 153
 
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
 	 *
173 173
 	 * @return array
174 174
 	 */
175
-	public function filter_templates( $page_templates = array() ) {
175
+	public function filter_templates($page_templates = array()) {
176 176
 
177 177
 		$custom_templates = ClassyView::get_page_templates_list();
178 178
 
179
-		return array_merge( $page_templates, $custom_templates );
179
+		return array_merge($page_templates, $custom_templates);
180 180
 
181 181
 	}
182 182
 
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
 	 *
188 188
 	 * @return mixed|bool Return false if variable not found.
189 189
 	 */
190
-	public static function get_config_var( $name ) {
190
+	public static function get_config_var($name) {
191 191
 
192 192
 		$vars = ClassyConfig::get_vars();
193 193
 
194
-		return ( isset( $vars[ $name ] ) ) ? $vars[ $name ] : false;
194
+		return (isset($vars[$name])) ? $vars[$name] : false;
195 195
 
196 196
 	}
197 197
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 	 */
203 203
 	public static function textdomain() {
204 204
 
205
-		$textdomain = Classy::get_config_var( 'textdomain' );
205
+		$textdomain = Classy::get_config_var('textdomain');
206 206
 
207 207
 		return $textdomain ? $textdomain : THEME;
208 208
 
@@ -217,17 +217,17 @@  discard block
 block discarded – undo
217 217
 	 * @param  array|null  $data     Additional params
218 218
 	 * @return void
219 219
 	 */
220
-	public static function render( $view = null, $data = null ) {
220
+	public static function render($view = null, $data = null) {
221 221
 
222
-		$views = THEME_PATH . ClassyView::$folder;
223
-		$cache = WP_CONTENT_DIR . '/viewcache';
222
+		$views = THEME_PATH.ClassyView::$folder;
223
+		$cache = WP_CONTENT_DIR.'/viewcache';
224 224
 		$common_scope = ClassyScope::get_common_scope();
225 225
 
226
-		if ( null !== $view && is_string( $view ) ) {
226
+		if (null !== $view && is_string($view)) {
227 227
 
228
-			if ( $data && is_array( $data ) ) {
228
+			if ($data && is_array($data)) {
229 229
 
230
-				$scope = array_merge( $common_scope, $data );
230
+				$scope = array_merge($common_scope, $data);
231 231
 
232 232
 			} else {
233 233
 
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 
243 243
 		}
244 244
 
245
-		$renderer = new BladeRenderer( $views, array( 'cache_path' => $cache ) );
245
+		$renderer = new BladeRenderer($views, array('cache_path' => $cache));
246 246
 
247
-		echo $renderer->render( $view, $scope ); // XSS: xss ok.
247
+		echo $renderer->render($view, $scope); // XSS: xss ok.
248 248
 
249 249
 	}
250 250
 
@@ -269,27 +269,27 @@  discard block
 block discarded – undo
269 269
 	 * @param  string  $return object/id/ClassyPost
270 270
 	 * @return mixed
271 271
 	 */
272
-	public static function get_posts( $args = false, $return = 'ClassyPost' ) {
272
+	public static function get_posts($args = false, $return = 'ClassyPost') {
273 273
 
274 274
 		$_return = array();
275 275
 
276
-		$query = ClassyQueryHelper::find_query( $args );
276
+		$query = ClassyQueryHelper::find_query($args);
277 277
 
278
-		if ( isset( $query->posts ) ) {
278
+		if (isset($query->posts)) {
279 279
 
280
-			foreach ( $query->posts as $post ) {
280
+			foreach ($query->posts as $post) {
281 281
 
282
-				if ( 'id' === $return ) {
282
+				if ('id' === $return) {
283 283
 
284 284
 					$_return[] = $post->id;
285 285
 
286
-				} elseif ( 'object' === $return ) {
286
+				} elseif ('object' === $return) {
287 287
 
288 288
 					$_return[] = $post;
289 289
 
290
-				} elseif ( class_exists( $return ) ) {
290
+				} elseif (class_exists($return)) {
291 291
 
292
-					$_return[] = new $return( $post );
292
+					$_return[] = new $return($post);
293 293
 
294 294
 				}
295 295
 			}
@@ -306,11 +306,11 @@  discard block
 block discarded – undo
306 306
 	 * @param  string  $return_type ClassyPost/object/id
307 307
 	 * @return mixed
308 308
 	 */
309
-	public static function get_post( $args = false, $return_type = 'ClassyPost' ) {
309
+	public static function get_post($args = false, $return_type = 'ClassyPost') {
310 310
 
311
-		$posts = self::get_posts( $args, $return_type );
311
+		$posts = self::get_posts($args, $return_type);
312 312
 
313
-		if ( $post = reset( $posts ) ) {
313
+		if ($post = reset($posts)) {
314 314
 			return $post;
315 315
 		}
316 316
 
@@ -320,62 +320,62 @@  discard block
 block discarded – undo
320 320
 	 * @param array   $prefs
321 321
 	 * @return array mixed
322 322
 	 */
323
-	public static function get_pagination( $prefs = array() ) {
323
+	public static function get_pagination($prefs = array()) {
324 324
 
325 325
 		global $wp_query;
326 326
 		global $paged;
327 327
 		global $wp_rewrite;
328 328
 
329 329
 		$args = array();
330
-		$args['total'] = ceil( $wp_query->found_posts / $wp_query->query_vars['posts_per_page'] );
330
+		$args['total'] = ceil($wp_query->found_posts / $wp_query->query_vars['posts_per_page']);
331 331
 
332
-		if ( $wp_rewrite->using_permalinks() ) {
332
+		if ($wp_rewrite->using_permalinks()) {
333 333
 
334
-			$url = explode( '?', get_pagenum_link( 0 ) );
334
+			$url = explode('?', get_pagenum_link(0));
335 335
 
336
-			if ( isset( $url[1] ) ) {
337
-				parse_str( $url[1], $query );
336
+			if (isset($url[1])) {
337
+				parse_str($url[1], $query);
338 338
 				$args['add_args'] = $query;
339 339
 			}
340 340
 
341 341
 			$args['format'] = 'page/%#%';
342
-			$args['base'] = trailingslashit( $url[0] ).'%_%';
342
+			$args['base'] = trailingslashit($url[0]).'%_%';
343 343
 
344 344
 		} else {
345 345
 			$big = 999999999;
346
-			$args['base'] = str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) );
346
+			$args['base'] = str_replace($big, '%#%', esc_url(get_pagenum_link($big)));
347 347
 		}
348 348
 
349 349
 		$args['type'] = 'array';
350
-		$args['current'] = max( 1, get_query_var( 'paged' ) );
351
-		$args['mid_size'] = max( 9 - $args['current'], 3 );
350
+		$args['current'] = max(1, get_query_var('paged'));
351
+		$args['mid_size'] = max(9 - $args['current'], 3);
352 352
 		$args['prev_next'] = false;
353 353
 
354
-		if ( is_int( $prefs ) ) {
354
+		if (is_int($prefs)) {
355 355
 			$args['mid_size'] = $prefs - 2;
356 356
 		} else {
357
-			$args = array_merge( $args, $prefs );
357
+			$args = array_merge($args, $prefs);
358 358
 		}
359 359
 
360 360
 		$data = array();
361
-		$data['pages'] = ClassyHelper::paginate_links( $args );
362
-		$next = get_next_posts_page_link( $args['total'] );
361
+		$data['pages'] = ClassyHelper::paginate_links($args);
362
+		$next = get_next_posts_page_link($args['total']);
363 363
 
364
-		if ( $next ) {
365
-			$data['next'] = array( 'link' => untrailingslashit( $next ), 'class' => 'page-numbers next' );
364
+		if ($next) {
365
+			$data['next'] = array('link' => untrailingslashit($next), 'class' => 'page-numbers next');
366 366
 		}
367 367
 
368
-		$prev = previous_posts( false );
368
+		$prev = previous_posts(false);
369 369
 
370
-		if ( $prev ) {
371
-			$data['prev'] = array( 'link' => untrailingslashit( $prev ), 'class' => 'page-numbers prev' );
370
+		if ($prev) {
371
+			$data['prev'] = array('link' => untrailingslashit($prev), 'class' => 'page-numbers prev');
372 372
 		}
373 373
 
374
-		if ( $paged < 2 ) {
374
+		if ($paged < 2) {
375 375
 			$data['prev'] = null;
376 376
 		}
377 377
 
378
-		return ClassyHelper::array_to_object( $data );
378
+		return ClassyHelper::array_to_object($data);
379 379
 
380 380
 	}
381 381
 }
Please login to merge, or discard this patch.
app/models/classy-user.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -61,6 +61,9 @@
 block discarded – undo
61 61
 		$this->init();
62 62
 	}
63 63
 
64
+	/**
65
+	 * @param integer|null $uid
66
+	 */
64 67
 	private function verify_id($uid) {
65 68
 		return $uid;
66 69
 	}
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
 	 * Main constructor function. Requires user id
61 61
 	 * @param int $uid
62 62
 	 */
63
-	public function __construct( $uid = null ) {
64
-		$this->ID = $this->verify_id( $uid );
63
+	public function __construct($uid = null) {
64
+		$this->ID = $this->verify_id($uid);
65 65
 
66 66
 		$this->init();
67 67
 	}
68 68
 
69
-	private function verify_id( $uid ) {
69
+	private function verify_id($uid) {
70 70
 		return $uid;
71 71
 	}
72 72
 
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 	private function init() {
77 77
 		$object = (array) $this->get_object();
78 78
 
79
-		$this->import( $object );
79
+		$this->import($object);
80 80
 
81
-		if ( isset( $this->first_name ) && isset( $this->last_name ) ) {
82
-			$this->name = $this->first_name . ' ' . $this->last_name;
81
+		if (isset($this->first_name) && isset($this->last_name)) {
82
+			$this->name = $this->first_name.' '.$this->last_name;
83 83
 		} else {
84 84
 			$this->name = 'Anonymous';
85 85
 		}
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	 * @return object
93 93
 	 */
94 94
 	private function get_object() {
95
-		return get_userdata( $this->ID );
95
+		return get_userdata($this->ID);
96 96
 	}
97 97
 
98 98
 	/**
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
 	 * @return string
157 157
 	 */
158 158
 	public function link() {
159
-		if ( ! $this->link ) {
160
-			$this->link = get_author_posts_url( $this->ID );
159
+		if (!$this->link) {
160
+			$this->link = get_author_posts_url($this->ID);
161 161
 		}
162 162
 
163 163
 		return $this->link;
Please login to merge, or discard this patch.
app/classy/classy-comment.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 	/**
63 63
 	 * Returns ClassyUser object of comment author
64 64
 	 * 
65
-	 * @return object ClassyUser
65
+	 * @return ClassyUser ClassyUser
66 66
 	 */
67 67
 	public function author() {
68 68
 		
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 	 *
81 81
 	 * @param WP_Comment $item
82 82
 	 */
83
-	public function __construct( $item ) {
83
+	public function __construct($item) {
84 84
 
85
-		if ( is_a( $item, 'WP_Comment' ) ) {
85
+		if (is_a($item, 'WP_Comment')) {
86 86
 
87
-			$this->import( $item );
87
+			$this->import($item);
88 88
 
89 89
 		}
90 90
 
@@ -97,15 +97,15 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function author() {
99 99
 
100
-		if ( $this->user_id ) {
100
+		if ($this->user_id) {
101 101
 
102
-			return new ClassyUser( $this->user_id );
102
+			return new ClassyUser($this->user_id);
103 103
 
104 104
 		} else {
105 105
 
106
-			$author = new ClassyUser( 0 );
106
+			$author = new ClassyUser(0);
107 107
 
108
-			if ( isset( $this->comment_author ) && $this->comment_author ) {
108
+			if (isset($this->comment_author) && $this->comment_author) {
109 109
 
110 110
 				$author->name = $this->comment_author;
111 111
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 * @return string
123 123
 	 */
124 124
 	public function content() {
125
-		return apply_filters( 'get_comment_text ', $this->comment_content );
125
+		return apply_filters('get_comment_text ', $this->comment_content);
126 126
 	}
127 127
 
128 128
 	/**
@@ -140,11 +140,11 @@  discard block
 block discarded – undo
140 140
 	 * @param  string $date_format
141 141
 	 * @return string
142 142
 	 */
143
-	public function date( $date_format = '' ) {
144
-		$df = $date_format ? $date_format : get_option( 'date_format' );
145
-		$the_date = (string) mysql2date( $df, $this->comment_date );
143
+	public function date($date_format = '') {
144
+		$df = $date_format ? $date_format : get_option('date_format');
145
+		$the_date = (string) mysql2date($df, $this->comment_date);
146 146
 
147
-		return apply_filters( 'get_comment_date ', $the_date, $df );
147
+		return apply_filters('get_comment_date ', $the_date, $df);
148 148
 	}
149 149
 
150 150
 	/**
@@ -163,26 +163,26 @@  discard block
 block discarded – undo
163 163
 	 * @param  string $default
164 164
 	 * @return string
165 165
 	 */
166
-	public function avatar( $size = 92, $default = '' ) {
166
+	public function avatar($size = 92, $default = '') {
167 167
 
168
-		if ( ! get_option( 'show_avatars' ) ) {
168
+		if (!get_option('show_avatars')) {
169 169
 			return false;
170 170
 		}
171 171
 
172
-		if ( ! is_numeric( $size ) ) { $size = '92'; }
172
+		if (!is_numeric($size)) { $size = '92'; }
173 173
 
174 174
 		$email = $this->get_avatar_email();
175 175
 		$email_hash = '';
176 176
 
177
-		if ( ! empty( $email ) ) {
178
-			$email_hash = md5( strtolower( trim( $email ) ) );
177
+		if (!empty($email)) {
178
+			$email_hash = md5(strtolower(trim($email)));
179 179
 		}
180 180
 
181
-		$host = $this->get_avatar_host( $email_hash );
182
-		$default = $this->get_default_avatar( $default, $email, $size, $host );
181
+		$host = $this->get_avatar_host($email_hash);
182
+		$default = $this->get_default_avatar($default, $email, $size, $host);
183 183
 
184
-		if ( ! empty( $email ) ) {
185
-			$avatar = $this->get_avatar_url( $default, $host, $email_hash, $size );
184
+		if (!empty($email)) {
185
+			$avatar = $this->get_avatar_url($default, $host, $email_hash, $size);
186 186
 		} else {
187 187
 			$avatar = $default;
188 188
 		}
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
199 199
 	protected function get_avatar_email() {
200 200
 
201 201
 		$id = (int) $this->user_id;
202
-		$user = get_userdata( $id );
202
+		$user = get_userdata($id);
203 203
 
204
-		if ( $user ) {
204
+		if ($user) {
205 205
 			$email = $user->user_email;
206 206
 		} else {
207 207
 			$email = $this->comment_author_email;
@@ -220,32 +220,32 @@  discard block
 block discarded – undo
220 220
 	 * @param  string $host
221 221
 	 * @return string
222 222
 	 */
223
-	protected function get_default_avatar( $default, $email, $size, $host ) {
223
+	protected function get_default_avatar($default, $email, $size, $host) {
224 224
 
225
-		if ( '/' === substr( $default, 0, 1 ) ) {
226
-			$default = home_url() . $default;
225
+		if ('/' === substr($default, 0, 1)) {
226
+			$default = home_url().$default;
227 227
 		}
228 228
 
229
-		if ( empty( $default ) ) {
230
-			$avatar_default = get_option( 'avatar_default' );
231
-			if ( empty( $avatar_default ) ) {
229
+		if (empty($default)) {
230
+			$avatar_default = get_option('avatar_default');
231
+			if (empty($avatar_default)) {
232 232
 				$default = 'mystery';
233 233
 			} else {
234 234
 				$default = $avatar_default;
235 235
 			}
236 236
 		}
237 237
 
238
-		if ( 'mystery' === $default ) {
239
-			$default = $host . '/avatar/ad516503a11cd5ca435acc9bb6523536?s=' . $size;
238
+		if ('mystery' === $default) {
239
+			$default = $host.'/avatar/ad516503a11cd5ca435acc9bb6523536?s='.$size;
240 240
 			// ad516503a11cd5ca435acc9bb6523536 == md5('[email protected]')
241
-		} else if ( 'blank' === $default ) {
242
-			$default = $email ? 'blank' : includes_url( 'images/blank.gif' );
243
-		} else if ( ! empty( $email ) && 'gravatar_default' === $default ) {
241
+		} else if ('blank' === $default) {
242
+			$default = $email ? 'blank' : includes_url('images/blank.gif');
243
+		} else if (!empty($email) && 'gravatar_default' === $default) {
244 244
 			$default = '';
245
-		} else if ( 'gravatar_default' === $default ) {
246
-			$default = $host . '/avatar/?s=' . $size;
247
-		} else if ( empty( $email ) && ! strstr( $default, 'http://' ) ) {
248
-			$default = $host . '/avatar/?d=' . $default . '&amp;s=' . $size;
245
+		} else if ('gravatar_default' === $default) {
246
+			$default = $host.'/avatar/?s='.$size;
247
+		} else if (empty($email) && !strstr($default, 'http://')) {
248
+			$default = $host.'/avatar/?d='.$default.'&amp;s='.$size;
249 249
 		}
250 250
 
251 251
 		return $default;
@@ -258,13 +258,13 @@  discard block
 block discarded – undo
258 258
 	 * @param  string $email_hash
259 259
 	 * @return string
260 260
 	 */
261
-	protected function get_avatar_host( $email_hash ) {
261
+	protected function get_avatar_host($email_hash) {
262 262
 
263
-		if ( is_ssl() ) {
263
+		if (is_ssl()) {
264 264
 			$host = 'https://secure.gravatar.com';
265 265
 		} else {
266
-			if ( ! empty( $email_hash ) ) {
267
-				$host = sprintf( 'http://%d.gravatar.com', (hexdec( $email_hash[0] ) % 2) );
266
+			if (!empty($email_hash)) {
267
+				$host = sprintf('http://%d.gravatar.com', (hexdec($email_hash[0]) % 2));
268 268
 			} else {
269 269
 				$host = 'http://0.gravatar.com';
270 270
 			}
@@ -283,16 +283,16 @@  discard block
 block discarded – undo
283 283
 	 * @param  int $size
284 284
 	 * @return string
285 285
 	 */
286
-	protected function get_avatar_url( $default, $host, $email_hash, $size ) {
286
+	protected function get_avatar_url($default, $host, $email_hash, $size) {
287 287
 
288
-		$_return = $host . '/avatar/' . $email_hash . '?s=' . $size . '&amp;d=' . urlencode( $default );
289
-		$rating = get_option( 'avatar_rating' );
288
+		$_return = $host.'/avatar/'.$email_hash.'?s='.$size.'&amp;d='.urlencode($default);
289
+		$rating = get_option('avatar_rating');
290 290
 
291
-		if ( ! empty( $rating ) ) {
292
-			$_return .= '&amp;r=' . $rating;
291
+		if (!empty($rating)) {
292
+			$_return .= '&amp;r='.$rating;
293 293
 		}
294 294
 
295
-		return str_replace( '&#038;', '&amp;', esc_url( $_return ) );
295
+		return str_replace('&#038;', '&amp;', esc_url($_return));
296 296
 
297 297
 	}
298 298
 
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
 	 *
302 302
 	 * @param ClassyComment $comment
303 303
 	 */
304
-	public function add_child( $comment ) {
304
+	public function add_child($comment) {
305 305
 
306 306
 		$this->children[] = $comment;
307 307
 		$item->level = $this->level + 1;
308 308
 
309
-		if ( $item->children ) {
309
+		if ($item->children) {
310 310
 			$this->update_child_levels();
311 311
 		}
312 312
 
@@ -320,9 +320,9 @@  discard block
 block discarded – undo
320 320
 	 */
321 321
 	protected function update_child_levels() {
322 322
 
323
-		if ( is_array( $this->children ) ) {
323
+		if (is_array($this->children)) {
324 324
 
325
-			foreach ( $this->children as $child ) {
325
+			foreach ($this->children as $child) {
326 326
 				$child->level = $this->level + 1;
327 327
 				$child->update_child_levels();
328 328
 			}
Please login to merge, or discard this patch.
app/classy/classy-scope.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -43,6 +43,7 @@
 block discarded – undo
43 43
 	/**
44 44
 	 * Extends Scope with scope that is defined in theme_name/scope folder
45 45
 	 * 
46
+	 * @param string|false $view_name
46 47
 	 * @return array
47 48
 	 */
48 49
 	public static function extend_scope($scope, $view_name) {
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -16,21 +16,21 @@  discard block
 block discarded – undo
16 16
 	 *
17 17
 	 * @return array
18 18
 	 */
19
-	public static function get_scope( $view_name = null ) {
19
+	public static function get_scope($view_name = null) {
20 20
 
21 21
 		$scope = self::get_common_scope();
22 22
 
23
-		if ( is_string( $view_name ) ) {
23
+		if (is_string($view_name)) {
24 24
 
25
-			$scope = self::extend_scope( $scope, $view_name );
25
+			$scope = self::extend_scope($scope, $view_name);
26 26
 
27 27
 		} else {
28 28
 
29 29
 			$request = ClassyHierarchy::get_current_request();
30 30
 
31
-			$file = ClassyHierarchy::get_available_file( 'scope', $request );
31
+			$file = ClassyHierarchy::get_available_file('scope', $request);
32 32
 
33
-			$scope = self::extend_scope( $scope, $file );
33
+			$scope = self::extend_scope($scope, $file);
34 34
 
35 35
 		}
36 36
 
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 	 *
45 45
 	 * @return array
46 46
 	 */
47
-	public static function extend_scope( $scope, $view_name ) {
47
+	public static function extend_scope($scope, $view_name) {
48 48
 
49
-		$scope = array_merge( $scope, self::require_scope( $view_name ) );
49
+		$scope = array_merge($scope, self::require_scope($view_name));
50 50
 
51 51
 		return $scope;
52 52
 
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	 */
61 61
 	public static function get_common_scope() {
62 62
 
63
-		if ( null === self::$common ) {
63
+		if (null === self::$common) {
64 64
 
65
-			self::$common = self::require_scope( 'common' );
65
+			self::$common = self::require_scope('common');
66 66
 
67 67
 		}
68 68
 
@@ -76,19 +76,19 @@  discard block
 block discarded – undo
76 76
 	 * @param  string $filename
77 77
 	 * @return array
78 78
 	 */
79
-	public static function require_scope( $filename ) {
79
+	public static function require_scope($filename) {
80 80
 
81 81
 		$_return = array();
82 82
 
83
-		$file = ClassyHierarchy::get_file_path( 'scope', $filename );
83
+		$file = ClassyHierarchy::get_file_path('scope', $filename);
84 84
 
85
-		if ( file_exists( $file ) ) {
85
+		if (file_exists($file)) {
86 86
 
87 87
 			require $file;
88 88
 
89 89
 		}
90 90
 
91
-		if ( isset( $data ) ) {
91
+		if (isset($data)) {
92 92
 
93 93
 			$_return = $data;
94 94
 
Please login to merge, or discard this patch.
app/classy/classy-basis.php 1 patch
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.
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-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.
app/classy/classy-hierarchy.php 2 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.
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 THEME_PATH . $folder . '/' . $view . '.blade.php';
98
+			return 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 THEME_PATH . $folder . '/' . $view . '.php';
104
+			return 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,43 +302,43 @@  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';
320 320
 
321
-		elseif ( 'page' === $type ) :
321
+		elseif ('page' === $type) :
322 322
 
323 323
 			$id = get_queried_object_id();
324 324
 
325
-			$pagename = get_query_var( 'pagename' );
325
+			$pagename = get_query_var('pagename');
326 326
 
327
-			if ( ! $pagename && $id ) {
327
+			if (!$pagename && $id) {
328 328
 				// If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
329 329
 				$post = get_queried_object();
330 330
 
331
-				if ( $post ) {
331
+				if ($post) {
332 332
 					$pagename = $post->post_name;
333 333
 				}
334 334
 			}
335 335
 
336
-			if ( $pagename ) {
337
-				$views[] = 'page.' . $pagename;
336
+			if ($pagename) {
337
+				$views[] = 'page.'.$pagename;
338 338
 			}
339 339
 
340
-			if ( $id ) {
341
-				$views[] = 'page.' . $id;
340
+			if ($id) {
341
+				$views[] = 'page.'.$id;
342 342
 			}
343 343
 
344 344
 			$views[] = 'page.page';
@@ -380,9 +380,9 @@  discard block
 block discarded – undo
380 380
 
381 381
 		$template_slug = get_page_template_slug();
382 382
 
383
-		preg_match( '/classy\-(.*)/', $template_slug, $matches );
383
+		preg_match('/classy\-(.*)/', $template_slug, $matches);
384 384
 
385
-		if ( ! empty( $matches ) && isset( $matches[1] ) ) { return $matches[1]; }
385
+		if (!empty($matches) && isset($matches[1])) { return $matches[1]; }
386 386
 
387 387
 		return false;
388 388
 
Please login to merge, or discard this patch.