File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -397,17 +397,13 @@ protected function prepareHandlers(array $handlers)
397
397
*/
398
398
protected function prepareHandler (HandlerInterface $ handler , array $ config = [])
399
399
{
400
- $ isHandlerFormattable = false ;
401
-
402
- if (Monolog::API === 1 ) {
403
- $ isHandlerFormattable = true ;
404
- } elseif (Monolog::API === 2 && $ handler instanceof FormattableHandlerInterface) {
405
- $ isHandlerFormattable = true ;
400
+ if (Monolog::API !== 1 && (Monolog::API !== 2 || ! $ handler instanceof FormattableHandlerInterface)) {
401
+ return $ handler ;
406
402
}
407
403
408
- if ($ isHandlerFormattable && ! isset ($ config ['formatter ' ])) {
404
+ if (! isset ($ config ['formatter ' ])) {
409
405
$ handler ->setFormatter ($ this ->formatter ());
410
- } elseif ($ isHandlerFormattable && $ config ['formatter ' ] !== 'default ' ) {
406
+ } elseif ($ config ['formatter ' ] !== 'default ' ) {
411
407
$ handler ->setFormatter ($ this ->app ->make ($ config ['formatter ' ], $ config ['formatter_with ' ] ?? []));
412
408
}
413
409
You can’t perform that action at this time.
0 commit comments