Passed
Push — master ( 0658f3...f968a7 )
by y
02:18
created

AsanaError::getCurlInfo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
namespace Helix\Asana\Api;
4
5
use RuntimeException;
6
7
/**
8
 * A cURL or API error.
9
 *
10
 * Codes less than `400` are cURL errors.
11
 *
12
 * The API class returns `null` on `404`, it doesn't throw.
13
 *
14
 * @see https://developers.asana.com/docs/errors
15
 */
16
class AsanaError extends RuntimeException {
17
18
    /**
19
     * @var array
20
     */
21
    protected $curlInfo;
22
23
    public function __construct (int $code, string $message, array $curlInfo) {
24
        parent::__construct($message, $code);
25
        $this->curlInfo = $curlInfo;
26
    }
27
28
    /**
29
     * @return array
30
     */
31
    public function getCurlInfo (): array {
32
        return $this->curlInfo;
33
    }
34
}