@@ -76,7 +76,7 @@ |
||
76 | 76 | if (preg_match(self::SCHEME_HOST_PORT_URI, $server, $matches)) { |
77 | 77 | $this->scheme = isset($matches['scheme']) ? $matches['scheme'] : "tcp://"; |
78 | 78 | $this->host = isset($matches['host']) ? $matches['host'] : self::DEFAULT_HOST; |
79 | - $this->port = isset($matches['port']) ? (int) substr($matches['port'], 1) : self::$defaultPorts[$this->scheme]; |
|
79 | + $this->port = isset($matches['port']) ? (int)substr($matches['port'], 1) : self::$defaultPorts[$this->scheme]; |
|
80 | 80 | } |
81 | 81 | else // Match attempt failed. |
82 | 82 | throw new \InvalidArgumentException(sprintf("'%s' is not a valid URI.", $server)); |
@@ -77,9 +77,10 @@ |
||
77 | 77 | $this->scheme = isset($matches['scheme']) ? $matches['scheme'] : "tcp://"; |
78 | 78 | $this->host = isset($matches['host']) ? $matches['host'] : self::DEFAULT_HOST; |
79 | 79 | $this->port = isset($matches['port']) ? (int) substr($matches['port'], 1) : self::$defaultPorts[$this->scheme]; |
80 | - } |
|
81 | - else // Match attempt failed. |
|
80 | + } else { |
|
81 | + // Match attempt failed. |
|
82 | 82 | throw new \InvalidArgumentException(sprintf("'%s' is not a valid URI.", $server)); |
83 | + } |
|
83 | 84 | |
84 | 85 | $this->userName = (string)$userName; |
85 | 86 | $this->password = (string)$password; |