Completed
Push — master ( 96a330...27efa4 )
by WEBEWEB
02:55
created

CURLRequestCallException::setResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of the curl-library package.
5
 *
6
 * (c) 2017 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\CURL\Exception;
13
14
use WBW\Library\CURL\Response\CURLResponse;
15
16
/**
17
 * cURL request call exception.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Library\CURL\Exception
21
 */
22
class CURLRequestCallException extends AbstractCURLException {
23
24
    /**
25
     * cURL response.
26
     *
27
     * @var CURLResponse
28
     */
29
    private $response;
30
31
    /**
32
     * Constructor.
33
     *
34
     * @param string $message The message.
35
     * @param int $code The code.
36
     * @param CURLResponse $response The response.
37
     */
38
    public function __construct($message, $code, CURLResponse $response) {
39
        parent::__construct($message, $code);
40
        $this->setResponse($response);
41
    }
42
43
    /**
44
     * Get the response.
45
     *
46
     * @return CURLResponse Returns the cURL response.
47
     */
48
    public function getResponse() {
49
        return $this->response;
50
    }
51
52
    /**
53
     * Set the response.
54
     *
55
     * @param CURLResponse $response The response.
56
     * @return CURLRequestCallException Returns this cURL request call exception.
57
     */
58
    protected function setResponse(CURLResponse $response) {
59
        $this->response = $response;
60
        return $this;
61
    }
62
63
}
64