@@ -40,7 +40,7 @@ class NormalizerFormatter implements FormatterInterface
40
40
public function __construct (?string $ dateFormat = null )
41
41
{
42
42
$ this ->dateFormat = null === $ dateFormat ? static ::SIMPLE_DATE : $ dateFormat ;
43
- if (!function_exists ('json_encode ' )) {
43
+ if (!\ function_exists ('json_encode ' )) {
44
44
throw new \RuntimeException ('PHP \'s json extension is required to use Monolog \'s NormalizerFormatter ' );
45
45
}
46
46
}
@@ -182,8 +182,8 @@ protected function normalize(mixed $data, int $depth = 0): mixed
182
182
return 'Over ' . $ this ->maxNormalizeDepth . ' levels deep, aborting normalization ' ;
183
183
}
184
184
185
- if (null === $ data || is_scalar ($ data )) {
186
- if (is_float ($ data )) {
185
+ if (null === $ data || \ is_scalar ($ data )) {
186
+ if (\ is_float ($ data )) {
187
187
if (is_infinite ($ data )) {
188
188
return ($ data > 0 ? '' : '- ' ) . 'INF ' ;
189
189
}
@@ -195,13 +195,13 @@ protected function normalize(mixed $data, int $depth = 0): mixed
195
195
return $ data ;
196
196
}
197
197
198
- if (is_array ($ data )) {
198
+ if (\ is_array ($ data )) {
199
199
$ normalized = [];
200
200
201
201
$ count = 1 ;
202
202
foreach ($ data as $ key => $ value ) {
203
203
if ($ count ++ > $ this ->maxNormalizeItemCount ) {
204
- $ normalized ['... ' ] = 'Over ' . $ this ->maxNormalizeItemCount . ' items ( ' .count ($ data ).' total), aborting normalization ' ;
204
+ $ normalized ['... ' ] = 'Over ' . $ this ->maxNormalizeItemCount . ' items ( ' .\ count ($ data ).' total), aborting normalization ' ;
205
205
break ;
206
206
}
207
207
@@ -215,7 +215,7 @@ protected function normalize(mixed $data, int $depth = 0): mixed
215
215
return $ this ->formatDate ($ data );
216
216
}
217
217
218
- if (is_object ($ data )) {
218
+ if (\ is_object ($ data )) {
219
219
if ($ data instanceof Throwable) {
220
220
return $ this ->normalizeException ($ data , $ depth );
221
221
}
@@ -244,11 +244,11 @@ protected function normalize(mixed $data, int $depth = 0): mixed
244
244
return [Utils::getClass ($ data ) => $ value ];
245
245
}
246
246
247
- if (is_resource ($ data )) {
247
+ if (\ is_resource ($ data )) {
248
248
return sprintf ('[resource(%s)] ' , get_resource_type ($ data ));
249
249
}
250
250
251
- return '[unknown( ' .gettype ($ data ).')] ' ;
251
+ return '[unknown( ' .\ gettype ($ data ).')] ' ;
252
252
}
253
253
254
254
/**
@@ -286,9 +286,9 @@ protected function normalizeException(Throwable $e, int $depth = 0)
286
286
}
287
287
288
288
if (isset ($ e ->detail )) {
289
- if (is_string ($ e ->detail )) {
289
+ if (\ is_string ($ e ->detail )) {
290
290
$ data ['detail ' ] = $ e ->detail ;
291
- } elseif (is_object ($ e ->detail ) || is_array ($ e ->detail )) {
291
+ } elseif (\ is_object ($ e ->detail ) || \ is_array ($ e ->detail )) {
292
292
$ data ['detail ' ] = $ this ->toJson ($ e ->detail , true );
293
293
}
294
294
}
0 commit comments