Completed
Push — master ( f1b023...fb5516 )
by Márk
02:31 queued 52s
created

Handler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 8 1
1
<?php
2
3
namespace Nofw\Emperror\Integration\Whoops;
4
5
use Nofw\Error\ErrorHandler;
6
7
/**
8
 * This handler provides integration with Whoops.
9
 *
10
 * @see http://filp.github.io/whoops/
11
 *
12
 * @author Márk Sági-Kazár <[email protected]>
13
 */
14
final class Handler extends \Whoops\Handler\Handler
15
{
16
    /**
17
     * @var ErrorHandler
18
     */
19
    private $errorHandler;
20
21
    public function __construct(ErrorHandler $errorHandler)
22
    {
23
        $this->errorHandler = $errorHandler;
24
    }
25
26
    public function handle(): int
27
    {
28
        $exception = $this->getException();
29
30
        $this->errorHandler->handle($exception);
31
32
        return self::DONE;
33
    }
34
}
35