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.

Logger::exception()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Teebot\Api\Logger;
6
7
use Monolog\{
8
    Handler\StreamHandler,
9
    Logger as Monolog
10
};
11
use Teebot\Configuration\ContainerInterface;
12
use Exception;
13
14
class Logger
15
{
16
    /**
17
     * @var ContainerInterface $config
18
     */
19
    protected $config;
20
21
    /**
22
     * @var Monolog
23
     */
24
    protected $logger;
25
26
    /**
27
     * @param ContainerInterface $config
28
     */
29
    public function __construct(ContainerInterface $config)
30
    {
31
        $this->config = $config;
32
        $filename     = TEEBOT_ROOT . $this->config->get('logger.filename');
33
        $this->logger = new Monolog('Teebot');
34
        $this->logger->pushHandler(
35
            new StreamHandler($filename, Monolog::WARNING)
36
        );
37
    }
38
39
    /**
40
     * @param Exception $exception
41
     */
42
    public function exception(Exception $exception)
43
    {
44
        $this->logger->warning($exception->getMessage());
45
    }
46
47
    /**
48
     * @param string $msg
49
     */
50
    public function warning(string $msg)
51
    {
52
        $this->logger->warning($msg);
53
    }
54
}
55