1 | <?php |
||
8 | class LoggerWrapper extends AbstractLogger |
||
9 | { |
||
10 | /** @var \Logger */ |
||
11 | private $logger; |
||
12 | |||
13 | /** @var DefaultFormatter */ |
||
14 | private $formatter; |
||
15 | |||
16 | /** @var int[] */ |
||
17 | private $levels; |
||
18 | |||
19 | /** @var string */ |
||
20 | private $defaultLevel; |
||
21 | |||
22 | /** |
||
23 | * Log4PhpPsr3Wrapper constructor. |
||
24 | * @param \Logger $logger |
||
25 | * @param FormatterInterface $formatter |
||
26 | * @param int[] $levels |
||
27 | * @param string $defaultLevel |
||
28 | */ |
||
29 | public function __construct( |
||
57 | |||
58 | /** |
||
59 | * Logs with an arbitrary level. |
||
60 | * |
||
61 | * @param mixed $level |
||
62 | * @param mixed $message |
||
63 | * @param mixed[] $context |
||
64 | * @return null |
||
65 | */ |
||
66 | public function log($level, $message, array $context = array()) |
||
78 | } |
||
79 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.