Options::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 10
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 4
1
<?php
2
/**
3
 * Shaper options
4
 * User: moyo
5
 * Date: 21/08/2017
6
 * Time: 6:32 PM
7
 */
8
9
namespace Carno\Shaping;
10
11
class Options
12
{
13
    /**
14
     * Capacity size. "0" = Leaky bucket, ">0" = Token bucket
15
     * @var int
16
     */
17
    public $capacity = 0;
18
19
    /**
20
     * Token's generating rate for bucket
21
     * @var int
22
     */
23
    public $bucketTGS = 0;
24
25
    /**
26
     * Max buffer size. more will be ignored
27
     * @var int
28
     */
29
    public $waitQMax = 0;
30
31
    /**
32
     * Wait timeout[ms] in buffer queue
33
     * @var int
34
     */
35
    public $waitTimeout = 0;
36
37
    /**
38
     * Options constructor.
39
     * @param int $capacity
40
     * @param int $bucketTGS
41
     * @param int $waitQMax
42
     * @param int $waitTimeout
43
     */
44
    public function __construct(
45
        int $capacity = 0,
46
        int $bucketTGS = 20000,
47
        int $waitQMax = 100000,
48
        int $waitTimeout = 2000
49
    ) {
50
        $this->capacity = $capacity;
51
        $this->bucketTGS = $bucketTGS;
52
        $this->waitQMax = $waitQMax;
53
        $this->waitTimeout = $waitTimeout;
54
    }
55
}
56