Pooling   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 9
dl 0
loc 46
c 0
b 0
f 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A pooling() 0 3 1
A keepalive() 0 5 1
A pooled() 0 3 2
A identify() 0 3 1
1
<?php
2
/**
3
 * Options of pooling
4
 * User: moyo
5
 * Date: 19/10/2017
6
 * Time: 3:19 PM
7
 */
8
9
namespace Carno\HTTP\Client\Options;
10
11
use Carno\Pool\Options;
12
13
trait Pooling
14
{
15
    /**
16
     * @var Options
17
     */
18
    private $pool = null;
19
20
    /**
21
     * @var string
22
     */
23
    private $identify = null;
24
25
    /**
26
     * @param Options $options
27
     * @param string $identify
28
     * @return static
29
     */
30
    public function keepalive(Options $options, string $identify = 'http') : self
31
    {
32
        $this->pool = $options;
33
        $this->identify = $identify;
34
        return $this;
35
    }
36
37
    /**
38
     * @return bool
39
     */
40
    public function pooled() : bool
41
    {
42
        return $this->pool ? true : false;
43
    }
44
45
    /**
46
     * @return Options
47
     */
48
    public function pooling() : Options
49
    {
50
        return $this->pool;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function identify() : string
57
    {
58
        return $this->identify;
59
    }
60
}
61