@@ -119,7 +119,9 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function initProfiler() |
| 121 | 121 | { |
| 122 | - if( func_get_arg(0) != static::DEBUG )return; |
|
| 122 | + if( func_get_arg(0) != static::DEBUG ) { |
|
| 123 | + return; |
|
| 124 | + } |
|
| 123 | 125 | $this->profiler->trace( func_get_arg(1) ); |
| 124 | 126 | } |
| 125 | 127 | |
@@ -140,7 +142,9 @@ discard block |
||
| 140 | 142 | public function render( $view, array $data = array() ) |
| 141 | 143 | { |
| 142 | 144 | $file = $this->path( sprintf( 'views/%s.php', str_replace( '.php', '', $view ))); |
| 143 | - if( !file_exists( $file ))return; |
|
| 145 | + if( !file_exists( $file )) { |
|
| 146 | + return; |
|
| 147 | + } |
|
| 144 | 148 | extract( $data ); |
| 145 | 149 | include $file; |
| 146 | 150 | } |
@@ -219,12 +223,14 @@ discard block |
||
| 219 | 223 | */ |
| 220 | 224 | protected function getIncludedFiles() |
| 221 | 225 | { |
| 222 | - $includes = array_values( array_filter( get_included_files(), function( $include ) { |
|
| 226 | + $includes = array_values( array_filter( get_included_files(), function( $include ) |
|
| 227 | + { |
|
| 223 | 228 | $bool = strpos( $include, '/themes/' ) !== false |
| 224 | 229 | && strpos( $include, '/functions.php' ) === false; |
| 225 | 230 | return (bool)apply_filters( 'blackbar/templates/include', $bool, $include ); |
| 226 | 231 | })); |
| 227 | - return array_map( function( $key, $value ) { |
|
| 232 | + return array_map( function( $key, $value ) |
|
| 233 | + { |
|
| 228 | 234 | $value = str_replace( trailingslashit( WP_CONTENT_DIR ), '', $value ); |
| 229 | 235 | return sprintf( '[%s] => %s', $key, $value ); |
| 230 | 236 | }, array_keys( $includes ), $includes ); |
@@ -250,7 +256,8 @@ discard block |
||
| 250 | 256 | 'AND', 'FROM', 'GROUP BY', 'INNER JOIN', 'LIMIT', 'ON DUPLICATE KEY UPDATE', |
| 251 | 257 | 'ORDER BY', 'SET', 'WHERE', |
| 252 | 258 | ); |
| 253 | - $replace = array_map( function( $value ) { |
|
| 259 | + $replace = array_map( function( $value ) |
|
| 260 | + { |
|
| 254 | 261 | return PHP_EOL.$value; |
| 255 | 262 | }, $search ); |
| 256 | 263 | foreach( $wpdb->queries as $query ) { |
@@ -289,7 +296,9 @@ discard block |
||
| 289 | 296 | */ |
| 290 | 297 | protected function getTemplates() |
| 291 | 298 | { |
| 292 | - if( is_admin() )return; |
|
| 299 | + if( is_admin() ) { |
|
| 300 | + return; |
|
| 301 | + } |
|
| 293 | 302 | if( class_exists( '\GeminiLabs\Castor\Facades\Development' )) { |
| 294 | 303 | ob_start(); |
| 295 | 304 | \GeminiLabs\Castor\Facades\Development::printTemplatePaths(); |