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.

ConsoleExceptionListener::onConsoleException()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
rs 9.4286
cc 1
eloc 11
nc 1
nop 1
1
<?php
2
3
namespace Opale\ConsoleExceptionBundle\Listener;
4
5
use Symfony\Component\Console\Event\ConsoleExceptionEvent;
6
use Psr\Log\LoggerInterface;
7
8
class ConsoleExceptionListener
9
{
10
    private $logger;
11
12
    public function __construct(LoggerInterface $logger)
13
    {
14
        $this->logger = $logger;
15
    }
16
17
    public function onConsoleException(ConsoleExceptionEvent $event)
18
    {
19
        $command = $event->getCommand();
20
        $exception = $event->getException();
21
22
        $message = sprintf(
23
            '%s: %s (uncaught exception) at %s line %s while running console command `%s`',
24
            get_class($exception),
25
            $exception->getMessage(),
26
            $exception->getFile(),
27
            $exception->getLine(),
28
            $command->getName()
29
        );
30
31
        $this->logger->error($message, array('exception' => $exception));
32
    }
33
}
34