Completed
Push — master ( ec1dbf...510cdb )
by Gabriel
04:59 queued 51s
created

DivideIQClient::setRequestTimeout()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace Stockbase\Integration\StockbaseApi\Client\DivideIQ;
5
6
use DivideBV\PHPDivideIQ\DivideIQ;
7
8
/**
9
 * DivideIQ API client with extended functionality.
10
 */
11
class DivideIQClient extends DivideIQ
12
{
13
    const DEFAULT_REQUEST_TIMEOUT = 60.0;
14
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function __construct($username, $password, $environment = 'production')
19
    {
20
        parent::__construct($username, $password, $environment);
21
        
22
        $this->setRequestTimeout(self::DEFAULT_REQUEST_TIMEOUT);
23
    }
24
25
    /**
26
     * Sets the request timeout value.
27
     *
28
     * @param float $timeout Timeout in seconds.
29
     */
30
    public function setRequestTimeout($timeout)
31
    {
32
        $this->client->setDefaultOption('timeout', $timeout);
33
    }
34
}
35