Completed
Push — master ( f191a4...75c234 )
by Andrew
02:27
created
app/classy/classy-menu-item.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
 	 */
125 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
 
@@ -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
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 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.
app/classy/classy-comment.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 	 * @param  string $date_format
111 111
 	 * @return string
112 112
 	 */
113
-	public function date( $date_format = '' ) {
113
+	public function date($date_format = '') {
114 114
 		$df = $date_format ? $date_format : get_option('date_format');
115
-		$the_date = (string)mysql2date($df, $this->comment_date);
115
+		$the_date = (string) mysql2date($df, $this->comment_date);
116 116
 
117 117
 		return apply_filters('get_comment_date ', $the_date, $df);
118 118
 	}
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 	 */
170 170
 	protected function get_avatar_email() {
171 171
 
172
-		$id = (int)$this->user_id;
172
+		$id = (int) $this->user_id;
173 173
 		$user = get_userdata($id);
174 174
 
175 175
 		if ($user) {
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	protected function get_default_avatar($default, $email, $size, $host) {
195 195
 		
196 196
 		if (substr($default, 0, 1) == '/') {
197
-			$default = home_url() . $default;
197
+			$default = home_url().$default;
198 198
 		}
199 199
 
200 200
 		if (empty($default)) {
@@ -207,16 +207,16 @@  discard block
 block discarded – undo
207 207
 		}
208 208
 
209 209
 		if ('mystery' == $default) {
210
-			$default = $host . '/avatar/ad516503a11cd5ca435acc9bb6523536?s=' . $size;
210
+			$default = $host.'/avatar/ad516503a11cd5ca435acc9bb6523536?s='.$size;
211 211
 			// ad516503a11cd5ca435acc9bb6523536 == md5('[email protected]')
212 212
 		} else if ('blank' == $default) {
213 213
 			$default = $email ? 'blank' : includes_url('images/blank.gif');
214 214
 		} else if (!empty($email) && 'gravatar_default' == $default) {
215 215
 			$default = '';
216 216
 		} else if ('gravatar_default' == $default) {
217
-			$default = $host . '/avatar/?s=' . $size;
217
+			$default = $host.'/avatar/?s='.$size;
218 218
 		} else if (empty($email) && !strstr($default, 'http://')) {
219
-			$default = $host . '/avatar/?d=' . $default . '&s=' . $size;
219
+			$default = $host.'/avatar/?d='.$default.'&s='.$size;
220 220
 		}
221 221
 
222 222
 		return $default;
@@ -256,11 +256,11 @@  discard block
 block discarded – undo
256 256
 	 */
257 257
 	protected function get_avatar_url($default, $host, $email_hash, $size) {
258 258
 		
259
-		$_return = $host . '/avatar/' . $email_hash . '?s=' . $size . '&d=' . urlencode($default);
259
+		$_return = $host.'/avatar/'.$email_hash.'?s='.$size.'&d='.urlencode($default);
260 260
 		$rating = get_option('avatar_rating');
261 261
 		
262 262
 		if (!empty($rating)) {
263
-			$_return .= '&r=' . $rating;
263
+			$_return .= '&r='.$rating;
264 264
 		}
265 265
 		
266 266
 		return str_replace('&', '&', esc_url($_return));
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 
294 294
 		if (is_array($this->children)) {
295 295
 		
296
-			foreach( $this->children as $child ) {
296
+			foreach ($this->children as $child) {
297 297
 				$child->level = $this->level + 1;
298 298
 				$child->update_child_levels();
299 299
 			}
Please login to merge, or discard this patch.
app/classy/classy.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * @return Classy A single instance of this class.
26 26
 	 */
27 27
 	public static function get_instance() {
28
-		if ( null === self::$single_instance ) {
28
+		if (null === self::$single_instance) {
29 29
 			self::$single_instance = new self();
30 30
 		}
31 31
 
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 	 * @param  string
56 56
 	 * @param  string
57 57
 	 */
58
-	private function define( $name, $value ) {
59
-		if ( !defined($name) ) {
58
+	private function define($name, $value) {
59
+		if (!defined($name)) {
60 60
 			
61
-			define( $name, $value );
61
+			define($name, $value);
62 62
 
63 63
 		}
64 64
 	}
@@ -72,61 +72,61 @@  discard block
 block discarded – undo
72 72
 	private function define_constants() {
73 73
 		$theme = wp_get_theme();
74 74
 
75
-		$this->define( 'THEME', $theme->template );
76
-		$this->define( 'THEME_NAME', $theme->get('Name') );
77
-		$this->define( 'THEME_PATH', get_template_directory() . '/' );
78
-		$this->define( 'THEME_DIR', get_template_directory_uri() . '/' );
79
-		$this->define( 'THEME_VERSION', $theme->get('Version') );
80
-		$this->define( 'THEME_FRAMEWORK_PATH', THEME_PATH . 'app/' );
81
-		$this->define( 'THEME_FRAMEWORK_DIR', THEME_DIR . 'app/' );
75
+		$this->define('THEME', $theme->template);
76
+		$this->define('THEME_NAME', $theme->get('Name'));
77
+		$this->define('THEME_PATH', get_template_directory().'/');
78
+		$this->define('THEME_DIR', get_template_directory_uri().'/');
79
+		$this->define('THEME_VERSION', $theme->get('Version'));
80
+		$this->define('THEME_FRAMEWORK_PATH', THEME_PATH.'app/');
81
+		$this->define('THEME_FRAMEWORK_DIR', THEME_DIR.'app/');
82 82
 	}
83 83
 
84 84
 	/**
85 85
 	 * Include core files that are responsible for theme render
86 86
 	 */
87 87
 	private function include_core_files() {
88
-		require_once THEME_PATH . 'vendor/autoload.php';
88
+		require_once THEME_PATH.'vendor/autoload.php';
89 89
 
90 90
 		// Basis Class
91
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-basis.php';
91
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-basis.php';
92 92
 
93 93
 		// Theme Config
94
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-config.php';
94
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-config.php';
95 95
 	
96 96
 		// Scope
97
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-scope.php';
97
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-scope.php';
98 98
 
99 99
 		// Template Loader
100
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-template.php';
100
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-template.php';
101 101
 
102 102
 		// Helper functions
103
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-helper.php';
103
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-helper.php';
104 104
 
105 105
 		// Query Helper
106
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-query-helper.php';
106
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-query-helper.php';
107 107
 
108 108
 		// Menu
109
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-menu.php';
109
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-menu.php';
110 110
 
111 111
 		// Menu Item
112
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-menu-item.php';
112
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-menu-item.php';
113 113
 
114 114
 		// Comment
115
-		require_once THEME_FRAMEWORK_PATH . 'classy/classy-comment.php';
115
+		require_once THEME_FRAMEWORK_PATH.'classy/classy-comment.php';
116 116
 
117 117
 		// Appearance
118
-		require_once THEME_FRAMEWORK_PATH . 'appearance.php';
118
+		require_once THEME_FRAMEWORK_PATH.'appearance.php';
119 119
 	}
120 120
 
121 121
 	/**
122 122
 	 * Include theme Object-Orienter models
123 123
 	 */
124 124
 	private function include_models() {
125
-		$files = (array) glob( THEME_FRAMEWORK_PATH . '/models/*.php' );
125
+		$files = (array) glob(THEME_FRAMEWORK_PATH.'/models/*.php');
126 126
 
127
-		foreach ( $files as $filename ) {
127
+		foreach ($files as $filename) {
128 128
 
129
-			if ( !empty($filename) ) {
129
+			if (!empty($filename)) {
130 130
 
131 131
 				require_once $filename;
132 132
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 				
213 213
 					$_return[] = new ClassyPost($post_id);
214 214
 				
215
-				} elseif($return_type == 'object') {
215
+				} elseif ($return_type == 'object') {
216 216
 
217 217
 					$_return[] = get_post($post_id);
218 218
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	public static function get_post($args = false, $return_type = 'ClassyPost') {
240 240
 		$posts = self::get_posts($args, $return_type);
241 241
 
242
-		if ( $post = reset($posts ) ) {
242
+		if ($post = reset($posts)) {
243 243
 			return $post;
244 244
 		}
245 245
 	}
@@ -248,57 +248,57 @@  discard block
 block discarded – undo
248 248
 	 * @param array   $prefs
249 249
 	 * @return array mixed
250 250
 	 */
251
-	public static function get_pagination( $prefs = array() ) {
251
+	public static function get_pagination($prefs = array()) {
252 252
 		global $wp_query;
253 253
 		global $paged;
254 254
 		global $wp_rewrite;
255 255
 
256 256
 		$args = array();
257
-		$args['total'] = ceil( $wp_query->found_posts / $wp_query->query_vars['posts_per_page'] );
257
+		$args['total'] = ceil($wp_query->found_posts / $wp_query->query_vars['posts_per_page']);
258 258
 		
259
-		if ( $wp_rewrite->using_permalinks() ) {
259
+		if ($wp_rewrite->using_permalinks()) {
260 260
 			
261
-			$url = explode( '?', get_pagenum_link( 0 ) );
261
+			$url = explode('?', get_pagenum_link(0));
262 262
 			
263
-			if ( isset( $url[1] ) ) {
264
-				parse_str( $url[1], $query );
263
+			if (isset($url[1])) {
264
+				parse_str($url[1], $query);
265 265
 				$args['add_args'] = $query;
266 266
 			}
267 267
 			
268 268
 			$args['format'] = 'page/%#%';
269
-			$args['base'] = trailingslashit( $url[0] ).'%_%';
269
+			$args['base'] = trailingslashit($url[0]).'%_%';
270 270
 
271 271
 		} else {
272 272
 			$big = 999999999;
273
-			$args['base'] = str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) );
273
+			$args['base'] = str_replace($big, '%#%', esc_url(get_pagenum_link($big)));
274 274
 		}
275 275
 
276 276
 		$args['type'] = 'array';
277
-		$args['current'] = max( 1, get_query_var( 'paged' ) );
278
-		$args['mid_size'] = max( 9 - $args['current'], 3 );
277
+		$args['current'] = max(1, get_query_var('paged'));
278
+		$args['mid_size'] = max(9 - $args['current'], 3);
279 279
 		$args['prev_next'] = false;
280 280
 		
281
-		if ( is_int( $prefs ) ) {
281
+		if (is_int($prefs)) {
282 282
 			$args['mid_size'] = $prefs - 2;
283 283
 		} else {
284
-			$args = array_merge( $args, $prefs );
284
+			$args = array_merge($args, $prefs);
285 285
 		}
286 286
 
287 287
 		$data = array();
288
-		$data['pages'] = ClassyHelper::paginate_links( $args );
289
-		$next = get_next_posts_page_link( $args['total'] );
288
+		$data['pages'] = ClassyHelper::paginate_links($args);
289
+		$next = get_next_posts_page_link($args['total']);
290 290
 		
291
-		if ( $next ) {
292
-			$data['next'] = array( 'link' => untrailingslashit( $next ), 'class' => 'page-numbers next' );
291
+		if ($next) {
292
+			$data['next'] = array('link' => untrailingslashit($next), 'class' => 'page-numbers next');
293 293
 		}
294 294
 
295
-		$prev = previous_posts( false );
295
+		$prev = previous_posts(false);
296 296
 		
297
-		if ( $prev ) {
298
-			$data['prev'] = array( 'link' => untrailingslashit( $prev ), 'class' => 'page-numbers prev' );
297
+		if ($prev) {
298
+			$data['prev'] = array('link' => untrailingslashit($prev), 'class' => 'page-numbers prev');
299 299
 		}
300 300
 		
301
-		if ( $paged < 2 ) {
301
+		if ($paged < 2) {
302 302
 			$data['prev'] = null;
303 303
 		}
304 304
 		
Please login to merge, or discard this patch.
app/models/classy-user.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 		$this->import($object);
81 81
 
82 82
 		if (isset($this->first_name) && isset($this->last_name)) {
83
-			$this->name = $this->first_name . ' ' . $this->last_name;
83
+			$this->name = $this->first_name.' '.$this->last_name;
84 84
 		} else {
85 85
 			$this->name = 'Anonymous';
86 86
 		}
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @return string
158 158
 	 */
159 159
 	public function link() {
160
-		if ( !$this->link ) {
160
+		if (!$this->link) {
161 161
 			$this->link = get_author_posts_url($this->ID);
162 162
 		}
163 163
 
Please login to merge, or discard this patch.