| Total Complexity | 5 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | public function identify() : string |
||
| 61 |