| Total Complexity | 8 |
| Total Lines | 98 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | trait HttpTrait |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var array |
||
| 18 | */ |
||
| 19 | public $options = []; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param int|float $timeout |
||
| 23 | * |
||
| 24 | * @return $this |
||
| 25 | * @throws ClientException |
||
| 26 | */ |
||
| 27 | 52 | public function timeout($timeout) |
|
| 28 | { |
||
| 29 | 52 | $this->options['timeout'] = ClientFilter::timeout($timeout); |
|
| 30 | |||
| 31 | 51 | return $this; |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param int|float $connectTimeout |
||
| 36 | * |
||
| 37 | * @return $this |
||
| 38 | * @throws ClientException |
||
| 39 | */ |
||
| 40 | 51 | public function connectTimeout($connectTimeout) |
|
| 41 | { |
||
| 42 | 51 | $this->options['connect_timeout'] = ClientFilter::connectTimeout($connectTimeout); |
|
| 43 | |||
| 44 | 50 | return $this; |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param bool $debug |
||
| 49 | * |
||
| 50 | * @return $this |
||
| 51 | */ |
||
| 52 | 14 | public function debug($debug) |
|
| 53 | { |
||
| 54 | 14 | $this->options['debug'] = $debug; |
|
| 55 | |||
| 56 | 14 | return $this; |
|
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @codeCoverageIgnore |
||
| 61 | * |
||
| 62 | * @param array $cert |
||
| 63 | * |
||
| 64 | * @return $this |
||
| 65 | */ |
||
| 66 | public function cert($cert) |
||
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @codeCoverageIgnore |
||
| 75 | * |
||
| 76 | * @param array|string $proxy |
||
| 77 | * |
||
| 78 | * @return $this |
||
| 79 | */ |
||
| 80 | public function proxy($proxy) |
||
| 85 | } |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @param mixed $verify |
||
| 89 | * |
||
| 90 | * @return $this |
||
| 91 | */ |
||
| 92 | 2 | public function verify($verify) |
|
| 93 | { |
||
| 94 | 2 | $this->options['verify'] = $verify; |
|
| 95 | |||
| 96 | 2 | return $this; |
|
| 97 | } |
||
| 98 | |||
| 99 | /** |
||
| 100 | * @param array $options |
||
| 101 | * |
||
| 102 | * @return $this |
||
| 103 | */ |
||
| 104 | 81 | public function options(array $options) |
|
| 111 | } |
||
| 112 | } |
||
| 113 |