Completed
Branch master (928280)
by Alexis
02:27
created

AccessDeniedException   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 66
rs 10
c 1
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getRequest() 0 4 1
A setRequest() 0 4 1
A getResponse() 0 4 1
A setResponse() 0 4 1
1
<?php
2
3
namespace App\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