CurlException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
/**
4
 * @copyright 2017 Vladimir Jimenez
5
 * @license   https://github.com/allejo/PhpPulse/blob/master/LICENSE.md MIT
6
 */
7
8
namespace allejo\DaPulse\Exceptions;
9
10
/**
11
 * An exception thrown if cURL were to face an issue while processing a request
12
 *
13
 * @package allejo\DaPulse\Exceptions
14
 * @since   0.1.0
15
 */
16
class CurlException extends \Exception
17
{
18
    /**
19
     * Create a new exception
20
     *
21
     * @param resource $cURLObject The cURL object used when cURL faced an issue
22
     *
23
     * @since 0.1.0
24
     */
25
    public function __construct ($cURLObject)
26
    {
27
        $this->code    = curl_errno($cURLObject);
28
        $this->message = sprintf("cURL Error %d: %s", $this->code, curl_error($cURLObject));
29
    }
30
}
31