You are here

public function EasyRdf_ParsedUri::toString in Drupal 8

Convert the parsed URI back into a string

Return value

string The URI as a string

1 call to EasyRdf_ParsedUri::toString()
EasyRdf_ParsedUri::__toString in core/modules/rdf/tests/src/Traits/EasyRdf_ParsedUri.php
Magic method to convert the URI, when casted, back to a string

File

core/modules/rdf/tests/src/Traits/EasyRdf_ParsedUri.php, line 325

Class

EasyRdf_ParsedUri
A RFC3986 compliant URI parser

Namespace

Drupal\Tests\rdf\Traits

Code

public function toString() {
  $str = '';
  if ($this->scheme !== null) {
    $str .= $this->scheme . ':';
  }
  if ($this->authority !== null) {
    $str .= '//' . $this->authority;
  }
  $str .= $this->path;
  if ($this->query !== null) {
    $str .= '?' . $this->query;
  }
  if ($this->fragment !== null) {
    $str .= '#' . $this->fragment;
  }
  return $str;
}