Passed
Push — master ( 32692a...12a81e )
by Sebastian
02:54
created

RequestHelper_Exception   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
eloc 4
c 2
b 1
f 0
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setResponse() 0 3 1
A getResponse() 0 3 1
1
<?php
2
/**
3
 * File containing the {@link RequestHelper_Exception} class.
4
 * @package Application Utils
5
 * @subpackage RequestHelper
6
 * @see RequestHelper_Exception
7
 */
8
9
declare(strict_types=1);
10
11
namespace AppUtils;
12
13
/**
14
 * Request helper exception class: all exceptions in the
15
 * request helper are of this type. If available, this
16
 * allows accessing the request response if the error 
17
 * occurred in the context of a sent request. 
18
 *
19
 * @package Application Utils
20
 * @subpackage RequestHelper
21
 * @author Sebastian Mordziol <[email protected]>
22
 */
23
class RequestHelper_Exception extends BaseException
24
{
25
   /**
26
    * @var RequestHelper_Response|NULL
27
    */
28
    protected $response = null;
29
 
30
    public function setResponse(RequestHelper_Response $response)
31
    {
32
        $this->response = $response;
33
    }
34
    
35
   /**
36
    * Retrieves the related response instance, if available.
37
    * 
38
    * @return RequestHelper_Response|NULL
39
    */
40
    public function getResponse() : ?RequestHelper_Response
41
    {
42
        return $this->response;
43
    }
44
}
45