* Validate the URI per RFC 2396 (https://datatracker.ietf.org/doc/html/rfc2396) * @param string $uri The URI to validate * @return string The validated URI * @throws VaasClientException If the URI is invalid */
(string $uri)
| 429 | * @throws VaasClientException If the URI is invalid |
| 430 | */ |
| 431 | public static function validUri(string $uri): string |
| 432 | { |
| 433 | if (!filter_var($uri, FILTER_VALIDATE_URL)) { |
| 434 | throw new VaasClientException('Invalid URI'); |
| 435 | } |
| 436 | return $uri; |
| 437 | } |
| 438 | } |