| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function setProxy(string $dsn) : self |
||
| 42 | { |
||
| 43 | switch (($parsed = parse_url($dsn))['scheme'] ?? 'http') { |
||
| 44 | case 'http': |
||
| 45 | $this->proxy = [ |
||
| 46 | 'host' => $parsed['host'] ?? '127.0.0.1', |
||
| 47 | 'port' => $parsed['port'] ?? 80, |
||
| 48 | 'user' => $parsed['user'] ?? null, |
||
| 49 | 'pass' => $parsed['pass'] ?? null, |
||
| 50 | ]; |
||
| 51 | break; |
||
| 52 | default: |
||
| 53 | throw new InvalidOptionsException(sprintf('Unsupported of proxy type "%s"', $parsed['scheme'])); |
||
| 54 | } |
||
| 55 | return $this; |
||
| 56 | } |
||
| 58 |