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

RequestHelper_Exception::getResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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