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

LoggerAwareTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A log() 0 4 2
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