function EasyRdf_ParsedUri::toString

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.