You are here

public function Uri::__construct in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-diactoros/src/Uri.php \Zend\Diactoros\Uri::__construct()
  2. 8 vendor/zendframework/zend-feed/src/Uri.php \Zend\Feed\Uri::__construct()
  3. 8 vendor/guzzlehttp/psr7/src/Uri.php \GuzzleHttp\Psr7\Uri::__construct()
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-diactoros/src/Uri.php \Zend\Diactoros\Uri::__construct()

Parameters

string $uri:

Throws

InvalidArgumentException on non-string $uri argument

File

vendor/zendframework/zend-diactoros/src/Uri.php, line 94

Class

Uri
Implementation of Psr\Http\UriInterface.

Namespace

Zend\Diactoros

Code

public function __construct($uri = '') {
  if (!is_string($uri)) {
    throw new InvalidArgumentException(sprintf('URI passed to constructor must be a string; received "%s"', is_object($uri) ? get_class($uri) : gettype($uri)));
  }
  if (!empty($uri)) {
    $this
      ->parseUri($uri);
  }
}