ArrayHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handler() 0 7 2
1
<?php
2
3
namespace Tleckie\Log\Formatter\Handler;
4
5
/**
6
 * Class ArrayHandler
7
 *
8
 * @package Tleckie\Log\Formatter\Handler
9
 * @author  Teodoro Leckie Westberg <[email protected]>
10
 */
11
class ArrayHandler extends Handler
12
{
13
    /**
14
     * @param mixed $message
15
     * @param array $context
16
     * @return string
17
     */
18
    public function handler(mixed $message, array $context = []): string
19
    {
20
        if (is_array($message)) {
21
            $message = $this->encode($message);
22
        }
23
24
        return parent::handler($message, $context);
25
    }
26
}
27