| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | public function __construct($host, array $options = []) { |
||
| 39 | $this->host = $host; |
||
| 40 | if (strstr($this->host, ':')) { |
||
| 41 | $this->port = (int)substr(strstr($this->host, ':'), 1); |
||
| 42 | $this->host = substr($this->host, 0, -1 - strlen($this->port)); |
||
| 43 | if (!$this->port) { |
||
| 44 | throw new \InvalidArgumentException('Invalid port number'); |
||
| 45 | } |
||
| 46 | } |
||
| 47 | $this->options = array_merge($this->options, $options); |
||
| 48 | } |
||
| 49 | |||
| 73 | } |