Failed Conditions
Push — issue#702_rs ( ed72a1...cdafcf )
by Guilherme
07:33
created

LoggerAwareTrait::log()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the login-cidadao project or it's bundles.
4
 *
5
 * (c) Guilherme Donato <guilhermednt on github>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace LoginCidadao\LogBundle\Traits;
12
13
use Psr\Log\LoggerInterface;
14
use Psr\Log\LoggerTrait;
15
16
trait LoggerAwareTrait
17
{
18
    use LoggerTrait;
19
    use \Psr\Log\LoggerAwareTrait;
20
21
    /**
22
     * Logs with an arbitrary level.
23
     *
24
     * @param mixed $level
25
     * @param string $message
26
     * @param array $context
27
     *
28
     * @return void
29
     */
30
    protected function log($level, $message, array $context = array())
31
    {
32
        if ($this->logger instanceof LoggerInterface) {
0 ignored issues
show
introduced by
$this->logger is always a sub-type of Psr\Log\LoggerInterface. If $this->logger can have other possible types, add them to vendor/psr/log/Psr/Log/LoggerAwareTrait.php:13.
Loading history...
33
            $this->logger->log($level, $message, $context);
34
        }
35
    }
36
}
37