Url: Improve documentation

refs #12133
This commit is contained in:
Noah Hilverling 2016-10-14 15:04:03 +02:00
parent 3e2f3c8467
commit ef359aa686
1 changed files with 8 additions and 12 deletions

View File

@ -206,27 +206,21 @@ class Url
if (isset($urlParts['query'])) { if (isset($urlParts['query'])) {
$params = UrlParams::fromQueryString($urlParts['query'])->mergeValues($params); $params = UrlParams::fromQueryString($urlParts['query'])->mergeValues($params);
} }
if (isset($urlParts['fragment'])) { if (isset($urlParts['fragment'])) {
$urlObject->setAnchor($urlParts['fragment']); $urlObject->setAnchor($urlParts['fragment']);
} }
if (isset($urlParts['host'])) { if (isset($urlParts['host'])) {
$urlObject->setHost($urlParts['host']); $urlObject->setHost($urlParts['host']);
} }
if (isset($urlParts['port'])) { if (isset($urlParts['port'])) {
$urlObject->setPort($urlParts['port']); $urlObject->setPort($urlParts['port']);
} }
if (isset($urlParts['scheme'])) { if (isset($urlParts['scheme'])) {
$urlObject->setScheme($urlParts['scheme']); $urlObject->setScheme($urlParts['scheme']);
} }
if (isset($urlParts['user'])) { if (isset($urlParts['user'])) {
$urlObject->setUsername($urlParts['user']); $urlObject->setUsername($urlParts['user']);
} }
if (isset($urlParts['pass'])) { if (isset($urlParts['pass'])) {
$urlObject->setPassword($urlParts['pass']); $urlObject->setPassword($urlParts['pass']);
} }
@ -310,7 +304,7 @@ class Url
} }
/** /**
* Return the host set for this Url * Return the host set for this url
* *
* @return string * @return string
*/ */
@ -320,9 +314,9 @@ class Url
} }
/** /**
* Overwrite the port * Set the port for this url
* *
* @param string $port New port of this Url * @param string $port New port of this url
* *
* @return $this * @return $this
*/ */
@ -343,7 +337,7 @@ class Url
} }
/** /**
* Overwrite the scheme * Set the scheme for this url
* *
* @param string $scheme The scheme used for this url * @param string $scheme The scheme used for this url
* *
@ -366,11 +360,11 @@ class Url
} }
/** /**
* Overwrite the baseUrl * Set the baseUrl for this url
* *
* @deprecated Please create a new url from scratch instead * @deprecated Please create a new url from scratch instead
* *
* @param string $baseUrl The url path to use as the Url Base * @param string $baseUrl The url path to use as the url base
* *
* @return $this * @return $this
*/ */
@ -392,6 +386,7 @@ class Url
if (isset($urlParts["pass"])) { if (isset($urlParts["pass"])) {
$this->setPassword($urlParts["pass"]); $this->setPassword($urlParts["pass"]);
} }
return $this; return $this;
} }
@ -407,6 +402,7 @@ class Url
if (!$this->isExternal()) { if (!$this->isExternal()) {
return ''; return '';
} }
return $this->getScheme() . '://' . $this->getHost() . ($this->getPort() ? (':' . $this->getPort()) : ''); return $this->getScheme() . '://' . $this->getHost() . ($this->getPort() ? (':' . $this->getPort()) : '');
} }