CurlException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
crap 2
1
<?php
2
3
namespace Fhp\Adapter\Exception;
4
5
/**
6
 * Class CurlException
7
 * @package Fhp\Adapter\Exception
8
 */
9
class CurlException extends AdapterException
10
{
11
    /**
12
     * @var mixed
13
     */
14
    protected $curlInfo;
15
16
    /**
17
     * CurlException constructor.
18
     *
19
     * @param string $message
20
     * @param int $code
21
     * @param \Exception|null $previous
22
     * @param mixed $curlInfo
23
     */
24
    public function __construct($message, $code = 0, \Exception $previous = null, $curlInfo)
25
    {
26
        parent::__construct($message, $code, $previous);
27
28
        $this->curlInfo = $curlInfo;
29
    }
30
31
    /**
32
     * Gets the curl info from request / response.
33
     *
34
     * @return mixed
35
     */
36
    public function getCurlInfo()
37
    {
38
        return $this->curlInfo;
39
    }
40
}
41