GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

LoggerCacheTrait::log()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
ccs 5
cts 5
cp 1
cc 2
eloc 3
nc 2
nop 3
crap 2
1
<?php
2
3
namespace Cmp\Cache\Traits;
4
5
use Psr\Log\LoggerAwareTrait;
6
use Psr\Log\LoggerTrait;
7
8
/**
9
 * Class LoggerCacheTrait
10
 * 
11
 * Apply to a cache backend to be able to log messages without having to take care if a logger is available
12
 *
13
 * @package Cmp\Cache\Traits
14
 */
15
trait LoggerCacheTrait
16
{
17
    use LoggerAwareTrait, LoggerTrait;
18
19
    /**
20
     * Logs with an arbitrary level if the logger is present
21
     *
22
     * @param mixed $level
23
     * @param string $message
24
     * @param array $context
25
     * @return null
26
     */
27 1
    public function log($level, $message, array $context = array())
28
    {
29 1
        if ($this->logger) {
30 1
            $this->logger->log($level, $message, $context);
31 1
        }
32 1
    }
33
}
34