@@ -59,16 +59,16 @@ discard block |
||
59 | 59 | /** |
60 | 60 | * @return bool |
61 | 61 | */ |
62 | - public static function shouldDeactivate( $file, array $args = [] ) |
|
62 | + public static function shouldDeactivate( $file, array $args = [ ] ) |
|
63 | 63 | { |
64 | - if( empty( static::$instance )) { |
|
64 | + if( empty( static::$instance ) ) { |
|
65 | 65 | static::$file = realpath( $file ); |
66 | 66 | static::$instance = new static; |
67 | 67 | static::$versions = static::normalize( $args ); |
68 | 68 | } |
69 | 69 | if( !static::isValid() ) { |
70 | - add_action( 'activated_plugin', array( static::$instance, 'deactivate' )); |
|
71 | - add_action( 'admin_notices', array( static::$instance, 'deactivate' )); |
|
70 | + add_action( 'activated_plugin', array( static::$instance, 'deactivate' ) ); |
|
71 | + add_action( 'admin_notices', array( static::$instance, 'deactivate' ) ); |
|
72 | 72 | return true; |
73 | 73 | } |
74 | 74 | return false; |
@@ -86,18 +86,18 @@ discard block |
||
86 | 86 | } |
87 | 87 | $pluginData = get_file_data( static::$file, array( 'name' => 'Plugin Name' ), 'plugin' ); |
88 | 88 | deactivate_plugins( $pluginSlug ); |
89 | - $this->printNotice( $pluginData['name'] ); |
|
89 | + $this->printNotice( $pluginData[ 'name' ] ); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
93 | 93 | * @return object |
94 | 94 | */ |
95 | - protected static function normalize( array $args = [] ) |
|
95 | + protected static function normalize( array $args = [ ] ) |
|
96 | 96 | { |
97 | 97 | return (object) wp_parse_args( $args, array( |
98 | 98 | 'php' => static::MIN_PHP_VERSION, |
99 | 99 | 'wordpress' => static::MIN_WORDPRESS_VERSION, |
100 | - )); |
|
100 | + ) ); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | filter_input( INPUT_GET, 'plugin_status' ), |
110 | 110 | filter_input( INPUT_GET, 'paged' ), |
111 | 111 | filter_input( INPUT_GET, 's' ) |
112 | - ))); |
|
112 | + ) ) ); |
|
113 | 113 | exit; |
114 | 114 | } |
115 | 115 | |
@@ -130,16 +130,16 @@ discard block |
||
130 | 130 | ); |
131 | 131 | if( !static::isPhpValid() ) { |
132 | 132 | printf( $noticeTemplate, |
133 | - sprintf( $messages[0], $pluginName ), |
|
134 | - sprintf( $messages[1], $messages[3].' '.(static::$versions)->php ), |
|
135 | - sprintf( $messages[2], PHP_VERSION ) |
|
133 | + sprintf( $messages[ 0 ], $pluginName ), |
|
134 | + sprintf( $messages[ 1 ], $messages[ 3 ] . ' ' . ( static::$versions )->php ), |
|
135 | + sprintf( $messages[ 2 ], PHP_VERSION ) |
|
136 | 136 | ); |
137 | 137 | } |
138 | 138 | else if( !static::isWpValid() ) { |
139 | 139 | printf( $noticeTemplate, |
140 | - sprintf( $messages[0], $pluginName ), |
|
141 | - sprintf( $messages[1], $messages[4].' '.(static::$versions)->wordpress ), |
|
142 | - sprintf( '<a href="%s">%s</a>', admin_url( 'update-core.php' ), $messages[5] ) |
|
140 | + sprintf( $messages[ 0 ], $pluginName ), |
|
141 | + sprintf( $messages[ 1 ], $messages[ 4 ] . ' ' . ( static::$versions )->wordpress ), |
|
142 | + sprintf( '<a href="%s">%s</a>', admin_url( 'update-core.php' ), $messages[ 5 ] ) |
|
143 | 143 | ); |
144 | 144 | } |
145 | 145 | } |
@@ -79,7 +79,9 @@ |
||
79 | 79 | */ |
80 | 80 | public function deactivate( $plugin ) |
81 | 81 | { |
82 | - if( static::isValid() )return; |
|
82 | + if( static::isValid() ) { |
|
83 | + return; |
|
84 | + } |
|
83 | 85 | $pluginSlug = plugin_basename( static::$file ); |
84 | 86 | if( $plugin == $pluginSlug ) { |
85 | 87 | $this->redirect(); //exit |
@@ -39,7 +39,8 @@ discard block |
||
39 | 39 | 'name' => 'Plugin Name', |
40 | 40 | 'version' => 'Version', |
41 | 41 | ], 'plugin' ); |
42 | - array_walk( $plugin, function( $value, $key ) { |
|
42 | + array_walk( $plugin, function( $value, $key ) |
|
43 | + { |
|
43 | 44 | $this->$key = $value; |
44 | 45 | }); |
45 | 46 | } |
@@ -62,7 +63,9 @@ discard block |
||
62 | 63 | */ |
63 | 64 | public function initLogger() |
64 | 65 | { |
65 | - if( func_get_arg(0) != static::ID )return; |
|
66 | + if( func_get_arg(0) != static::ID ) { |
|
67 | + return; |
|
68 | + } |
|
66 | 69 | $type = func_get_arg(2) |
67 | 70 | ? func_get_arg(2) |
68 | 71 | : 'debug'; |
@@ -75,7 +78,9 @@ discard block |
||
75 | 78 | public function clearLog() |
76 | 79 | { |
77 | 80 | $request = filter_input( INPUT_POST, static::ID, FILTER_DEFAULT , FILTER_REQUIRE_ARRAY ); |
78 | - if( empty( $request['action'] ) || $request['action'] != 'clear-log' )return; |
|
81 | + if( empty( $request['action'] ) || $request['action'] != 'clear-log' ) { |
|
82 | + return; |
|
83 | + } |
|
79 | 84 | check_admin_referer( $request['action'] ); |
80 | 85 | $this->log->clear(); |
81 | 86 | add_action( 'admin_notices', [$this, 'renderNotice'] ); |
@@ -131,7 +136,9 @@ discard block |
||
131 | 136 | */ |
132 | 137 | public function render( $view, array $data = [] ) |
133 | 138 | { |
134 | - if( !file_exists( $file = $this->path( 'views/'.$view.'.php' )))return; |
|
139 | + if( !file_exists( $file = $this->path( 'views/'.$view.'.php' ))) { |
|
140 | + return; |
|
141 | + } |
|
135 | 142 | extract( $data ); |
136 | 143 | include $file; |
137 | 144 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public static function load() |
23 | 23 | { |
24 | - if( empty( static::$instance )) { |
|
24 | + if( empty( static::$instance ) ) { |
|
25 | 25 | static::$instance = new static; |
26 | 26 | } |
27 | 27 | return static::$instance; |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function __construct() |
34 | 34 | { |
35 | - $this->file = trailingslashit( dirname( __DIR__ )).static::ID.'.php'; |
|
36 | - $this->log = new Log( $this->path( 'development.log' )); |
|
35 | + $this->file = trailingslashit( dirname( __DIR__ ) ) . static::ID . '.php'; |
|
36 | + $this->log = new Log( $this->path( 'development.log' ) ); |
|
37 | 37 | $plugin = get_file_data( $this->file, [ |
38 | 38 | 'languages' => 'Domain Path', |
39 | 39 | 'name' => 'Plugin Name', |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function init() |
51 | 51 | { |
52 | - add_action( 'admin_init', [$this, 'clearLog'] ); |
|
53 | - add_action( 'plugins_loaded', [$this, 'registerLanguages'] ); |
|
54 | - add_action( 'admin_menu', [$this, 'registerMenu'] ); |
|
55 | - add_action( 'admin_menu', [$this, 'registerSettings'] ); |
|
56 | - add_filter( 'all', [$this, 'initLogger'] ); |
|
52 | + add_action( 'admin_init', [ $this, 'clearLog' ] ); |
|
53 | + add_action( 'plugins_loaded', [ $this, 'registerLanguages' ] ); |
|
54 | + add_action( 'admin_menu', [ $this, 'registerMenu' ] ); |
|
55 | + add_action( 'admin_menu', [ $this, 'registerSettings' ] ); |
|
56 | + add_filter( 'all', [ $this, 'initLogger' ] ); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function initLogger() |
64 | 64 | { |
65 | - if( func_get_arg(0) != static::ID )return; |
|
66 | - $type = func_get_arg(2) |
|
67 | - ? func_get_arg(2) |
|
65 | + if( func_get_arg( 0 ) != static::ID )return; |
|
66 | + $type = func_get_arg( 2 ) |
|
67 | + ? func_get_arg( 2 ) |
|
68 | 68 | : 'debug'; |
69 | - $this->log->log( $type, func_get_arg(1) ); |
|
69 | + $this->log->log( $type, func_get_arg( 1 ) ); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function clearLog() |
76 | 76 | { |
77 | - $request = filter_input( INPUT_POST, static::ID, FILTER_DEFAULT , FILTER_REQUIRE_ARRAY ); |
|
78 | - if( empty( $request['action'] ) || $request['action'] != 'clear-log' )return; |
|
79 | - check_admin_referer( $request['action'] ); |
|
77 | + $request = filter_input( INPUT_POST, static::ID, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); |
|
78 | + if( empty( $request[ 'action' ] ) || $request[ 'action' ] != 'clear-log' )return; |
|
79 | + check_admin_referer( $request[ 'action' ] ); |
|
80 | 80 | $this->log->clear(); |
81 | - add_action( 'admin_notices', [$this, 'renderNotice'] ); |
|
81 | + add_action( 'admin_notices', [ $this, 'renderNotice' ] ); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function path( $file = '' ) |
89 | 89 | { |
90 | - return plugin_dir_path( $this->file ).ltrim( trim( $file ), '/' ); |
|
90 | + return plugin_dir_path( $this->file ) . ltrim( trim( $file ), '/' ); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | public function registerLanguages() |
97 | 97 | { |
98 | 98 | load_plugin_textdomain( static::ID, '', |
99 | - trailingslashit( plugin_basename( $this->path() ).'/'.$this->languages ) |
|
99 | + trailingslashit( plugin_basename( $this->path() ) . '/' . $this->languages ) |
|
100 | 100 | ); |
101 | 101 | } |
102 | 102 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | __( 'Logger', 'logger' ), |
113 | 113 | 'manage_options', |
114 | 114 | static::ID, |
115 | - [$this, 'renderSettingsPage'] |
|
115 | + [ $this, 'renderSettingsPage' ] |
|
116 | 116 | ); |
117 | 117 | } |
118 | 118 | |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | * @param string $view |
130 | 130 | * @return void|null |
131 | 131 | */ |
132 | - public function render( $view, array $data = [] ) |
|
132 | + public function render( $view, array $data = [ ] ) |
|
133 | 133 | { |
134 | - if( !file_exists( $file = $this->path( 'views/'.$view.'.php' )))return; |
|
134 | + if( !file_exists( $file = $this->path( 'views/' . $view . '.php' ) ) )return; |
|
135 | 135 | extract( $data ); |
136 | 136 | include $file; |
137 | 137 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $this->render( 'notice', [ |
145 | 145 | 'notice' => __( 'The log was cleared.', 'logger' ), |
146 | 146 | 'status' => 'success', |
147 | - ]); |
|
147 | + ] ); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | 'log' => $this->log, |
159 | 159 | 'settings' => $this->getSettings(), |
160 | 160 | 'title' => __( 'Logger', 'logger' ), |
161 | - ]); |
|
161 | + ] ); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
@@ -166,12 +166,12 @@ discard block |
||
166 | 166 | */ |
167 | 167 | protected function getSettings() |
168 | 168 | { |
169 | - $settings = get_option( static::ID, [] ); |
|
170 | - if( empty( $settings )) { |
|
169 | + $settings = get_option( static::ID, [ ] ); |
|
170 | + if( empty( $settings ) ) { |
|
171 | 171 | update_option( static::ID, $settings = [ |
172 | 172 | 'enabled' => 0, |
173 | - ]); |
|
173 | + ] ); |
|
174 | 174 | } |
175 | - return (object)$settings; |
|
175 | + return (object) $settings; |
|
176 | 176 | } |
177 | 177 | } |
@@ -4,16 +4,16 @@ |
||
4 | 4 | |
5 | 5 | spl_autoload_register( function( $className ) { |
6 | 6 | $namespaces = array( |
7 | - 'GeminiLabs\\Logger\\' => __DIR__.'/plugin/', |
|
7 | + 'GeminiLabs\\Logger\\' => __DIR__ . '/plugin/', |
|
8 | 8 | ); |
9 | 9 | foreach( $namespaces as $prefix => $base_dir ) { |
10 | 10 | $len = strlen( $prefix ); |
11 | 11 | if( strncmp( $prefix, $className, $len ) !== 0 )continue; |
12 | - $file = $base_dir.str_replace( '\\', '/', substr( $className, $len )).'.php'; |
|
13 | - if( !file_exists( $file ))continue; |
|
12 | + $file = $base_dir . str_replace( '\\', '/', substr( $className, $len ) ) . '.php'; |
|
13 | + if( !file_exists( $file ) )continue; |
|
14 | 14 | require $file; |
15 | 15 | break; |
16 | 16 | } |
17 | 17 | }); |
18 | 18 | |
19 | -require_once( ABSPATH.'/wp-admin/includes/file.php' ); |
|
19 | +require_once( ABSPATH . '/wp-admin/includes/file.php' ); |
@@ -2,15 +2,20 @@ |
||
2 | 2 | |
3 | 3 | defined( 'WPINC' ) || die; |
4 | 4 | |
5 | -spl_autoload_register( function( $className ) { |
|
5 | +spl_autoload_register( function( $className ) |
|
6 | +{ |
|
6 | 7 | $namespaces = array( |
7 | 8 | 'GeminiLabs\\Logger\\' => __DIR__.'/plugin/', |
8 | 9 | ); |
9 | 10 | foreach( $namespaces as $prefix => $base_dir ) { |
10 | 11 | $len = strlen( $prefix ); |
11 | - if( strncmp( $prefix, $className, $len ) !== 0 )continue; |
|
12 | + if( strncmp( $prefix, $className, $len ) !== 0 ) { |
|
13 | + continue; |
|
14 | + } |
|
12 | 15 | $file = $base_dir.str_replace( '\\', '/', substr( $className, $len )).'.php'; |
13 | - if( !file_exists( $file ))continue; |
|
16 | + if( !file_exists( $file )) { |
|
17 | + continue; |
|
18 | + } |
|
14 | 19 | require $file; |
15 | 20 | break; |
16 | 21 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | <input type="hidden" id="enabled" name="<?= $id; ?>[enabled]" value="<?= wp_validate_boolean( $settings->enabled ) ? 0 : 1; ?>"> |
21 | 21 | <input type="submit" name="submit" id="submit" class="button button-primary" value="<?= wp_validate_boolean( $settings->enabled ) ? __( 'Disable Logging', 'logger' ) : __( 'Enable Logging', 'logger' ); ?>"> |
22 | 22 | </form> |
23 | - <?php if( wp_validate_boolean( $settings->enabled )) : ?> |
|
23 | + <?php if( wp_validate_boolean( $settings->enabled ) ) : ?> |
|
24 | 24 | <br> |
25 | 25 | <form method="post" class="float-left"> |
26 | 26 | <textarea class="large-text code" rows="20" id="log-file" onclick="this.select()" readonly><?= $log; ?></textarea> |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | |
18 | 18 | defined( 'WPINC' ) || die; |
19 | 19 | |
20 | -if( !class_exists( 'GL_Activate' )) { |
|
21 | - require_once __DIR__.'/activate.php'; |
|
20 | +if( !class_exists( 'GL_Activate' ) ) { |
|
21 | + require_once __DIR__ . '/activate.php'; |
|
22 | 22 | } |
23 | -require_once __DIR__.'/autoload.php'; |
|
24 | -if( GL_Activate::shouldDeactivate( __FILE__ ))return; |
|
23 | +require_once __DIR__ . '/autoload.php'; |
|
24 | +if( GL_Activate::shouldDeactivate( __FILE__ ) )return; |
|
25 | 25 | GeminiLabs\Logger\Application::load()->init(); |
26 | 26 | |
27 | 27 | /** |
@@ -32,6 +32,6 @@ discard block |
||
32 | 32 | function gllog( $message = null ) { |
33 | 33 | $logger = GeminiLabs\Logger\Application::load()->log->logger(); |
34 | 34 | return func_num_args() > 0 |
35 | - ? $logger->debug( func_get_arg(0) ) |
|
35 | + ? $logger->debug( func_get_arg( 0 ) ) |
|
36 | 36 | : $logger; |
37 | 37 | } |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | require_once __DIR__.'/activate.php'; |
22 | 22 | } |
23 | 23 | require_once __DIR__.'/autoload.php'; |
24 | -if( GL_Activate::shouldDeactivate( __FILE__ ))return; |
|
24 | +if( GL_Activate::shouldDeactivate( __FILE__ )) { |
|
25 | + return; |
|
26 | +} |
|
25 | 27 | GeminiLabs\Logger\Application::load()->init(); |
26 | 28 | |
27 | 29 | /** |
@@ -30,7 +32,8 @@ discard block |
||
30 | 32 | * @return GeminiLabs\Logger\Log |
31 | 33 | * @scrutinizer ignore-unused |
32 | 34 | */ |
33 | -function gllog( $message = null ) { |
|
35 | +function gllog( $message = null ) |
|
36 | +{ |
|
34 | 37 | $logger = GeminiLabs\Logger\Application::load()->log->logger(); |
35 | 38 | return func_num_args() > 0 |
36 | 39 | ? $logger->debug( func_get_arg(0) ) |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param array $context |
41 | 41 | * @return static |
42 | 42 | */ |
43 | - public function alert( $message, array $context = [] ) |
|
43 | + public function alert( $message, array $context = [ ] ) |
|
44 | 44 | { |
45 | 45 | return $this->log( static::ALERT, $message, $context ); |
46 | 46 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @param array $context |
62 | 62 | * @return static |
63 | 63 | */ |
64 | - public function critical( $message, array $context = [] ) |
|
64 | + public function critical( $message, array $context = [ ] ) |
|
65 | 65 | { |
66 | 66 | return $this->log( static::CRITICAL, $message, $context ); |
67 | 67 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @param array $context |
73 | 73 | * @return static |
74 | 74 | */ |
75 | - public function debug( $message, array $context = [] ) |
|
75 | + public function debug( $message, array $context = [ ] ) |
|
76 | 76 | { |
77 | 77 | return $this->log( static::DEBUG, $message, $context ); |
78 | 78 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @param array $context |
84 | 84 | * @return static |
85 | 85 | */ |
86 | - public function emergency( $message, array $context = [] ) |
|
86 | + public function emergency( $message, array $context = [ ] ) |
|
87 | 87 | { |
88 | 88 | return $this->log( static::EMERGENCY, $message, $context ); |
89 | 89 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @param array $context |
96 | 96 | * @return static |
97 | 97 | */ |
98 | - public function error( $message, array $context = [] ) |
|
98 | + public function error( $message, array $context = [ ] ) |
|
99 | 99 | { |
100 | 100 | return $this->log( static::ERROR, $message, $context ); |
101 | 101 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @param array $context |
108 | 108 | * @return static |
109 | 109 | */ |
110 | - public function info( $message, array $context = [] ) |
|
110 | + public function info( $message, array $context = [ ] ) |
|
111 | 111 | { |
112 | 112 | return $this->log( static::INFO, $message, $context ); |
113 | 113 | } |
@@ -118,12 +118,12 @@ discard block |
||
118 | 118 | * @param array $context |
119 | 119 | * @return static |
120 | 120 | */ |
121 | - public function log( $level, $message, array $context = [] ) |
|
121 | + public function log( $level, $message, array $context = [ ] ) |
|
122 | 122 | { |
123 | - $constants = (new ReflectionClass( __NAMESPACE__.'\Log' ))->getConstants(); |
|
124 | - $constants = (array)apply_filters( Application::ID.'/log-levels', $constants ); |
|
125 | - if( in_array( $level, $constants, true )) { |
|
126 | - $date = get_date_from_gmt( gmdate('Y-m-d H:i:s') ); |
|
123 | + $constants = ( new ReflectionClass( __NAMESPACE__ . '\Log' ) )->getConstants(); |
|
124 | + $constants = (array) apply_filters( Application::ID . '/log-levels', $constants ); |
|
125 | + if( in_array( $level, $constants, true ) ) { |
|
126 | + $date = get_date_from_gmt( gmdate( 'Y-m-d H:i:s' ) ); |
|
127 | 127 | $level = strtoupper( $level ); |
128 | 128 | $message = $this->interpolate( $message, $context ); |
129 | 129 | $entry = "[$date] $level: $message" . PHP_EOL; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @param array $context |
147 | 147 | * @return static |
148 | 148 | */ |
149 | - public function notice( $message, array $context = [] ) |
|
149 | + public function notice( $message, array $context = [ ] ) |
|
150 | 150 | { |
151 | 151 | return $this->log( static::NOTICE, $message, $context ); |
152 | 152 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @param array $context |
160 | 160 | * @return static |
161 | 161 | */ |
162 | - public function warning( $message, array $context = [] ) |
|
162 | + public function warning( $message, array $context = [ ] ) |
|
163 | 163 | { |
164 | 164 | return $this->log( static::WARNING, $message, $context ); |
165 | 165 | } |
@@ -169,14 +169,14 @@ discard block |
||
169 | 169 | * @param array $context |
170 | 170 | * @return array|string |
171 | 171 | */ |
172 | - protected function interpolate( $message, array $context = [] ) |
|
172 | + protected function interpolate( $message, array $context = [ ] ) |
|
173 | 173 | { |
174 | - if( $this->isObjectOrArray( $value )) { |
|
174 | + if( $this->isObjectOrArray( $value ) ) { |
|
175 | 175 | return print_r( $message, true ); |
176 | 176 | } |
177 | - $replace = []; |
|
177 | + $replace = [ ]; |
|
178 | 178 | foreach( $context as $key => $value ) { |
179 | - $replace['{'.$key.'}'] = $this->normalizeValue( $value ); |
|
179 | + $replace[ '{' . $key . '}' ] = $this->normalizeValue( $value ); |
|
180 | 180 | } |
181 | 181 | return strtr( $message, $replace ); |
182 | 182 | } |
@@ -199,11 +199,11 @@ discard block |
||
199 | 199 | if( $value instanceof DateTime ) { |
200 | 200 | $value = $value->format( 'Y-m-d H:i:s' ); |
201 | 201 | } |
202 | - else if( $this->isObjectOrArray( $value )) { |
|
202 | + else if( $this->isObjectOrArray( $value ) ) { |
|
203 | 203 | $value = json_encode( $value ); |
204 | 204 | } |
205 | - else if( is_resource( $value )) { |
|
206 | - $value = (string)$value; |
|
205 | + else if( is_resource( $value ) ) { |
|
206 | + $value = (string) $value; |
|
207 | 207 | } |
208 | 208 | return $value; |
209 | 209 | } |