Completed
Push — master ( 9a8fc2...1b152a )
by Jeroen van
13s queued 11s
created

CurlException::getInfo()   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 0
1
<?php
2
3
namespace VCR\Util;
4
5
class CurlException extends \Exception
6
{
7
    /**
8
     * @var array<string,mixed>
9
     */
10
    private $info;
11
12
    /**
13
     * @param resource $ch The cURL handler
14
     *
15
     * @return CurlException
16
     */
17
    public static function create($ch): self
18
    {
19
        $e = new self(curl_error($ch), curl_errno($ch));
20
        $e->info = curl_getinfo($ch);
0 ignored issues
show
Documentation Bug introduced by
It seems like curl_getinfo($ch) of type * is incompatible with the declared type array<string,*> of property $info.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
21
22
        return $e;
23
    }
24
25
    /**
26
     * Returns the curl_info array.
27
     *
28
     * @return array<string,mixed>
29
     */
30
    public function getInfo(): array
31
    {
32
        return $this->info;
33
    }
34
}
35