Failed Conditions
Push — preview-1.19.0 ( 7438ce...cca8d0 )
by Guilherme
12:04
created

LoggerAwareTrait::log()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 3
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 2
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 1
    protected function log($level, $message, array $context = array())
31
    {
32 1
        if ($this->logger instanceof LoggerInterface) {
0 ignored issues
show
introduced by
$this->logger is always a sub-type of Psr\Log\LoggerInterface.
Loading history...
33 1
            $this->logger->log($level, $message, $context);
34
        }
35 1
    }
36
}
37