Passed
Push — master ( 83b89e...48455b )
by Hannes
02:13
created

RequestException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getRequest() 0 3 1
A getContext() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace inroutephp\inroute\Runtime\Exception;
6
7
use Psr\Http\Message\ServerRequestInterface;
8
9
class RequestException extends RuntimeException
10
{
11
    /**
12
     * @var ServerRequestInterface
13
     */
14
    private $request;
15
16
    /**
17
     * @var array
18
     */
19
    private $context;
20
21
    public function __construct(ServerRequestInterface $request, array $context = [])
22
    {
23
        parent::__construct();
24
        $this->request = $request;
25
        $this->context = $context;
26
    }
27
28
    public function getRequest(): ServerRequestInterface
29
    {
30
        return $this->request;
31
    }
32
33
    public function getContext(): array
34
    {
35
        return $this->context;
36
    }
37
}
38