Completed
Push — master ( 6dbbae...39d3db )
by Alexis
01:47
created

AccessDeniedException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
1
<?php
2
3
namespace Security\Exception;
4
5
use Exception;
6
use Psr\Http\Message\ResponseInterface;
7
use Psr\Http\Message\ServerRequestInterface;
8
9
class AccessDeniedException extends Exception
10
{
11
    /**
12
     * @var ServerRequestInterface
13
     */
14
    protected $request;
15
16
    /**
17
     * @var ResponseInterface
18
     */
19
    protected $response;
20
21
    /**
22
     * Constructor.
23
     *
24
     * @param ServerRequestInterface $request
25
     * @param ResponseInterface      $response
26
     */
27
    public function __construct(ServerRequestInterface $request, ResponseInterface $response)
28
    {
29
        parent::__construct('Access denied');
30
31
        $this->request = $request;
32
        $this->response = $response;
33
    }
34
35
    /**
36
     * Gets the request.
37
     *
38
     * @return ServerRequestInterface
39
     */
40
    public function getRequest()
41
    {
42
        return $this->request;
43
    }
44
45
    /**
46
     * Sets the request.
47
     *
48
     * @param ServerRequestInterface $request
49
     */
50
    public function setRequest(ServerRequestInterface $request)
51
    {
52
        $this->request = $request;
53
    }
54
55
    /**
56
     * Gets the response.
57
     *
58
     * @return ResponseInterface
59
     */
60
    public function getResponse()
61
    {
62
        return $this->response;
63
    }
64
65
    /**
66
     * Sets the response.
67
     *
68
     * @param ResponseInterface $response
69
     */
70
    public function setResponse(ResponseInterface $response)
71
    {
72
        $this->response = $response;
73
    }
74
}
75