Code Duplication    Length = 11-12 lines in 2 locations

src/Transport/Curl.php 1 location

@@ 28-38 (lines=11) @@
25
     * @param int|float $timeout Timeout in seconds
26
     * @throws \Exception
27
     */
28
    public function __construct($timeout)
29
    {
30
        if (!is_int($timeout) && !is_float($timeout)) {
31
            throw new \InvalidArgumentException('Timeout must be integer or float');
32
        }
33
        if (!function_exists('curl_init')) {
34
            throw new \Exception('cURL extension not installed/enabled');
35
        }
36
37
        $this->timeoutMillis = floor($timeout * 1000);
38
    }
39
40
    /**
41
     * @inheritDoc

src/Transport/PersistentCurl.php 1 location

@@ 31-42 (lines=12) @@
28
     * @param int|float $timeout Timeout in seconds
29
     * @throws \Exception
30
     */
31
    public function __construct($timeout)
32
    {
33
        if (!is_int($timeout) && !is_float($timeout)) {
34
            throw new \InvalidArgumentException('Timeout must be integer or float');
35
        }
36
        if (!function_exists('curl_init')) {
37
            throw new \Exception('cURL extension not installed/enabled');
38
        }
39
40
        $this->timeoutMillis = floor($timeout * 1000);
41
        $this->curl = null;
42
    }
43
44
    /**
45
     * @inheritDoc