@@ -9,25 +9,25 @@ discard block |
||
9 | 9 | public function capture() |
10 | 10 | { |
11 | 11 | ob_start(); |
12 | - call_user_func_array( [$this, 'printF'], func_get_args() ); |
|
12 | + call_user_func_array([$this, 'printF'], func_get_args()); |
|
13 | 13 | return ob_get_clean(); |
14 | 14 | } |
15 | 15 | |
16 | 16 | public function className() |
17 | 17 | { |
18 | - return $this->isDev() && in_array( DEV, ['css', true] ) |
|
18 | + return $this->isDev() && in_array(DEV, ['css', true]) |
|
19 | 19 | ? 'dev' |
20 | 20 | : ''; |
21 | 21 | } |
22 | 22 | |
23 | 23 | public function debug() |
24 | 24 | { |
25 | - call_user_func_array( [$this, 'printF'], func_get_args() ); |
|
25 | + call_user_func_array([$this, 'printF'], func_get_args()); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | public function isDev() |
29 | 29 | { |
30 | - return defined( 'DEV' ) && !!DEV && WP_ENV == 'development'; |
|
30 | + return defined('DEV') && !!DEV && WP_ENV == 'development'; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function isProduction() |
@@ -35,30 +35,30 @@ discard block |
||
35 | 35 | return WP_ENV == 'production'; |
36 | 36 | } |
37 | 37 | |
38 | - public function printFiltersFor( $hook = '' ) |
|
38 | + public function printFiltersFor($hook = '') |
|
39 | 39 | { |
40 | 40 | global $wp_filter; |
41 | - if( empty( $hook ) || !isset( $wp_filter[$hook] ))return; |
|
42 | - $this->printF( $wp_filter[ $hook ] ); |
|
41 | + if (empty($hook) || !isset($wp_filter[$hook]))return; |
|
42 | + $this->printF($wp_filter[$hook]); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | public function printTemplatePaths() |
46 | 46 | { |
47 | - if( $this->isDev() && ( DEV == 'templates' || DEV === true )) { |
|
48 | - $templates = array_keys( array_flip( $this->templatePaths )); |
|
49 | - $templates = array_map( function( $key, $value ) { |
|
50 | - return sprintf( '[%s] => %s', $key, $value ); |
|
51 | - }, array_keys( $templates ), $templates ); |
|
47 | + if ($this->isDev() && (DEV == 'templates' || DEV === true)) { |
|
48 | + $templates = array_keys(array_flip($this->templatePaths)); |
|
49 | + $templates = array_map(function($key, $value) { |
|
50 | + return sprintf('[%s] => %s', $key, $value); |
|
51 | + }, array_keys($templates), $templates); |
|
52 | 52 | |
53 | - $this->printF( implode( "\n", $templates )); |
|
53 | + $this->printF(implode("\n", $templates)); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | - public function storeTemplatePath( $template ) |
|
57 | + public function storeTemplatePath($template) |
|
58 | 58 | { |
59 | - if( is_string( $template )) { |
|
60 | - $themeName = basename( strstr( $template, '/templates/', true )); |
|
61 | - $this->templatePaths[] = $themeName . strstr( $template, '/templates/' ); |
|
59 | + if (is_string($template)) { |
|
60 | + $themeName = basename(strstr($template, '/templates/', true)); |
|
61 | + $this->templatePaths[] = $themeName . strstr($template, '/templates/'); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
@@ -66,15 +66,15 @@ discard block |
||
66 | 66 | { |
67 | 67 | $args = func_num_args(); |
68 | 68 | |
69 | - if( $args == 1 ) { |
|
70 | - printf( '<div class="print__r"><pre>%s</pre></div>', |
|
71 | - htmlspecialchars( print_r( func_get_arg(0), true ), ENT_QUOTES, 'UTF-8' ) |
|
69 | + if ($args == 1) { |
|
70 | + printf('<div class="print__r"><pre>%s</pre></div>', |
|
71 | + htmlspecialchars(print_r(func_get_arg(0), true), ENT_QUOTES, 'UTF-8') |
|
72 | 72 | ); |
73 | 73 | } |
74 | - else if( $args > 1 ) { |
|
74 | + else if ($args > 1) { |
|
75 | 75 | echo '<div class="print__r_group">'; |
76 | - foreach( func_get_args() as $value ) { |
|
77 | - $this->printF( $value ); |
|
76 | + foreach (func_get_args() as $value) { |
|
77 | + $this->printF($value); |
|
78 | 78 | } |
79 | 79 | echo '</div>'; |
80 | 80 | } |
@@ -38,7 +38,9 @@ discard block |
||
38 | 38 | public function printFiltersFor( $hook = '' ) |
39 | 39 | { |
40 | 40 | global $wp_filter; |
41 | - if( empty( $hook ) || !isset( $wp_filter[$hook] ))return; |
|
41 | + if( empty( $hook ) || !isset( $wp_filter[$hook] )) { |
|
42 | + return; |
|
43 | + } |
|
42 | 44 | $this->printF( $wp_filter[ $hook ] ); |
43 | 45 | } |
44 | 46 | |
@@ -70,8 +72,7 @@ discard block |
||
70 | 72 | printf( '<div class="print__r"><pre>%s</pre></div>', |
71 | 73 | htmlspecialchars( print_r( func_get_arg(0), true ), ENT_QUOTES, 'UTF-8' ) |
72 | 74 | ); |
73 | - } |
|
74 | - else if( $args > 1 ) { |
|
75 | + } else if( $args > 1 ) { |
|
75 | 76 | echo '<div class="print__r_group">'; |
76 | 77 | foreach( func_get_args() as $value ) { |
77 | 78 | $this->printF( $value ); |