ExceptionHandler::renderForConsole()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace SfCod\QueueBundle\Handler;
4
5
use Exception;
6
use Psr\Log\LoggerInterface;
7
8
/**
9
 * ExceptionHandler
10
 *
11
 * @author Virchenko Maksim <[email protected]>
12
 */
13
class ExceptionHandler implements ExceptionHandlerInterface
14
{
15
    /**
16
     * @var LoggerInterface
17
     */
18
    protected $logger;
19
20
    /**
21
     * ExceptionHandler constructor.
22
     *
23
     * @param LoggerInterface $logger
24
     */
25
    public function __construct(LoggerInterface $logger)
26
    {
27
        $this->logger = $logger;
28
    }
29
30
    /**
31
     * Report or log an exception.
32
     *
33
     * @param \Exception $e
34
     */
35
    public function report(Exception $e)
36
    {
37
        $this->logger->error($e->getMessage(), ['exception' => $e]);
38
    }
39
40
    /**
41
     * Render an exception into an HTTP response.
42
     *
43
     * @param \HttpRequest $request
44
     * @param \Exception $e
45
     *
46
     * @return \Symfony\Component\HttpFoundation\Response|void
47
     */
48
    public function render($request, Exception $e)
49
    {
50
        return;
51
    }
52
53
    /**
54
     * Render an exception to the console.
55
     *
56
     * @param \Symfony\Component\Console\Output\OutputInterface $output
57
     * @param \Exception $e
58
     */
59
    public function renderForConsole($output, Exception $e)
60
    {
61
        return;
62
    }
63
}
64