| Total Complexity | 11 |
| Total Lines | 106 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Options |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var float |
||
| 11 | */ |
||
| 12 | private float $timeout = 6.00; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var float |
||
| 16 | */ |
||
| 17 | private float $connectTimeout = 6.00; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var string|null |
||
| 21 | */ |
||
| 22 | private null|string $proxy; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param float $timeout |
||
| 26 | * @return $this |
||
| 27 | */ |
||
| 28 | public function setTimeout(float $timeout): Options |
||
| 29 | { |
||
| 30 | $this->timeout = $timeout; |
||
| 31 | |||
| 32 | return $this; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return float |
||
| 37 | */ |
||
| 38 | public function getTimeout(): float |
||
| 39 | { |
||
| 40 | return $this->timeout; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param $connectTimeout |
||
| 45 | * @return $this |
||
| 46 | */ |
||
| 47 | public function setConnectTimeout($connectTimeout): Options |
||
| 48 | { |
||
| 49 | $this->connectTimeout = $connectTimeout; |
||
| 50 | |||
| 51 | return $this; |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return float |
||
| 56 | */ |
||
| 57 | public function getConnectTimeout(): float |
||
| 58 | { |
||
| 59 | return $this->connectTimeout; |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param string $proxy |
||
| 64 | * @return $this |
||
| 65 | */ |
||
| 66 | public function setProxy(string $proxy): Options |
||
| 67 | { |
||
| 68 | $this->proxy = $proxy; |
||
| 69 | |||
| 70 | return $this; |
||
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @return string |
||
| 75 | */ |
||
| 76 | public function getProxy(): string |
||
| 79 | } |
||
| 80 | |||
| 81 | |||
| 82 | /** |
||
| 83 | * @param Options $options |
||
| 84 | * @return $this |
||
| 85 | */ |
||
| 86 | public function setFromOptions(Options $options): Options |
||
| 91 | } |
||
| 92 | |||
| 93 | /** |
||
| 94 | * @return array |
||
| 95 | */ |
||
| 96 | public function toArray(): array |
||
| 113 | } |
||
| 114 | } |
||
| 115 |