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/guzzlehttp/psr7/src/Uri.php \GuzzleHttp\Psr7\Uri::__construct()

Parameters

string $uri URI to parse and wrap.:

File

vendor/guzzlehttp/psr7/src/Uri.php, line 47

Class

Uri
Basic PSR-7 URI implementation.

Namespace

GuzzleHttp\Psr7

Code

public function __construct($uri = '') {
  if ($uri != null) {
    $parts = parse_url($uri);
    if ($parts === false) {
      throw new \InvalidArgumentException("Unable to parse URI: {$uri}");
    }
    $this
      ->applyParts($parts);
  }
}