| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class HttpConfig implements ConfigInterface |
||
| 8 | { |
||
| 9 | public function __construct( |
||
| 10 | public float $timeout = 5.0, |
||
| 11 | public float $connect_timeout = 5.0, |
||
| 12 | public array $options = [], |
||
| 13 | ) { |
||
| 14 | } |
||
| 15 | |||
| 16 | public function toArray(): array |
||
| 17 | { |
||
| 18 | return array_merge( |
||
| 19 | [ |
||
| 20 | 'timeout' => $this->timeout, |
||
| 21 | 'connect_timeout' => $this->connect_timeout, |
||
| 22 | ], |
||
| 23 | $this->options |
||
| 24 | ); |
||
| 25 | } |
||
| 26 | |||
| 27 | public static function fromArray(array $config): self |
||
| 37 | ); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |