@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function get() |
110 | 110 | { |
111 | - return empty( $this->log ) |
|
111 | + return empty($this->log) |
|
112 | 112 | ? __( 'Log is empty', 'site-reviews' ) |
113 | 113 | : $this->log; |
114 | 114 | } |
@@ -120,11 +120,11 @@ discard block |
||
120 | 120 | public function humanSize( $valueIfEmpty = null ) |
121 | 121 | { |
122 | 122 | $bytes = $this->size(); |
123 | - if( empty( $bytes ) && is_string( $valueIfEmpty )) { |
|
123 | + if( empty($bytes) && is_string( $valueIfEmpty ) ) { |
|
124 | 124 | return $valueIfEmpty; |
125 | 125 | } |
126 | - $exponent = floor( log( max( $bytes, 1 ), 1024 )); |
|
127 | - return round( $bytes / pow( 1024, $exponent ), 2 ).['B','KB','MB','GB'][$exponent]; |
|
126 | + $exponent = floor( log( max( $bytes, 1 ), 1024 ) ); |
|
127 | + return round( $bytes / pow( 1024, $exponent ), 2 ).['B', 'KB', 'MB', 'GB'][$exponent]; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | { |
149 | 149 | $constants = (new ReflectionClass( __CLASS__ ))->getConstants(); |
150 | 150 | $constants = (array)apply_filters( 'site-reviews/log-levels', $constants ); |
151 | - if( in_array( $level, $constants, true )) { |
|
151 | + if( in_array( $level, $constants, true ) ) { |
|
152 | 152 | $entry = $this->buildLogEntry( $level, $message, $context ); |
153 | - file_put_contents( $this->file, $entry, FILE_APPEND|LOCK_EX ); |
|
153 | + file_put_contents( $this->file, $entry, FILE_APPEND | LOCK_EX ); |
|
154 | 154 | $this->reset(); |
155 | 155 | } |
156 | 156 | return $this; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | protected function interpolate( $message, $context = [] ) |
224 | 224 | { |
225 | - if( $this->isObjectOrArray( $message ) || !is_array( $context )) { |
|
225 | + if( $this->isObjectOrArray( $message ) || !is_array( $context ) ) { |
|
226 | 226 | return print_r( $message, true ); |
227 | 227 | } |
228 | 228 | $replace = []; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | if( $value instanceof DateTime ) { |
251 | 251 | $value = $value->format( 'Y-m-d H:i:s' ); |
252 | 252 | } |
253 | - else if( $this->isObjectOrArray( $value )) { |
|
253 | + else if( $this->isObjectOrArray( $value ) ) { |
|
254 | 254 | $value = json_encode( $value ); |
255 | 255 | } |
256 | 256 | return (string)$value; |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | $this->clear(); |
266 | 266 | file_put_contents( |
267 | 267 | $this->file, |
268 | - $this->buildLogEntry( 'info', __( 'Console was automatically reset (128 KB max size)', 'site-reviews' )) |
|
268 | + $this->buildLogEntry( 'info', __( 'Console was automatically reset (128 KB max size)', 'site-reviews' ) ) |
|
269 | 269 | ); |
270 | 270 | } |
271 | 271 | } |