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

DivideIQClient   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 24
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A setRequestTimeout() 0 4 1
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