Options::setTimeouts()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 16
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 5
1
<?php
2
/**
3
 * HTTP Options (client side)
4
 * User: moyo
5
 * Date: 25/09/2017
6
 * Time: 11:13 AM
7
 */
8
9
namespace Carno\HTTP;
10
11
use Carno\HTTP\Client\Options\Followed;
12
use Carno\HTTP\Client\Options\Pooling;
13
use Carno\HTTP\Client\Options\Proxy;
14
15
class Options
16
{
17
    use Followed, Pooling, Proxy;
18
19
    /**
20
     * @var int
21
     */
22
    public $ttOverall = 0;
23
24
    /**
25
     * @var int
26
     */
27
    public $ttLookup = 0;
28
29
    /**
30
     * @var int
31
     */
32
    public $ttConnect = 0;
33
34
    /**
35
     * @var int
36
     */
37
    public $ttSend = 0;
38
39
    /**
40
     * @var int
41
     */
42
    public $ttWait = 0;
43
44
    /**
45
     * @param int $overall
46
     * @param int $lookup
47
     * @param int $connect
48
     * @param int $send
49
     * @param int $wait
50
     * @return static
51
     */
52
    public function setTimeouts(
53
        int $overall = 3500,
54
        int $lookup = 1000,
55
        int $connect = 500,
56
        int $send = 1000,
57
        int $wait = 2000
58
    ) : self {
59
        $this->ttOverall = $overall;
60
61
        $this->ttLookup = $lookup;
62
        $this->ttConnect = $connect;
63
64
        $this->ttSend = $send;
65
        $this->ttWait = $wait;
66
67
        return $this;
68
    }
69
}
70