mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 23:08:41 +00:00
Reduce redundant assignments
This commit is contained in:
parent
4f5da9b3db
commit
0deb040847
|
|
@ -212,6 +212,7 @@ class Request extends RequestAbstract
|
||||||
UriFactory::setQuery(':user', $this->uri->getUser());
|
UriFactory::setQuery(':user', $this->uri->getUser());
|
||||||
UriFactory::setQuery(':pass', $this->uri->getPass());
|
UriFactory::setQuery(':pass', $this->uri->getPass());
|
||||||
|
|
||||||
|
// todo: flush previous
|
||||||
foreach($this->data as $key => $value) {
|
foreach($this->data as $key => $value) {
|
||||||
UriFactory::setQuery('?' . $key, $value);
|
UriFactory::setQuery('?' . $key, $value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -157,16 +157,15 @@ class Http implements UriInterface
|
||||||
$this->pass = $url['pass'] ?? null;
|
$this->pass = $url['pass'] ?? null;
|
||||||
$this->path = $url['path'] ?? null;
|
$this->path = $url['path'] ?? null;
|
||||||
|
|
||||||
if(StringUtils::endsWith($this->path, '.php')) {
|
if (StringUtils::endsWith($this->path, '.php')) {
|
||||||
$this->path = substr($this->path, 0, -4);
|
$this->path = substr($this->path, 0, -4);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->path = strpos($this->path, $this->rootPath) === 0 ? substr($this->path, strlen($this->rootPath), strlen($this->path)) : $this->path; // TODO: this could cause a bug if the rootpath is the same as a regular path which is usually the language
|
$this->path = strpos($this->path, $this->rootPath) === 0 ? substr($this->path, strlen($this->rootPath), strlen($this->path)) : $this->path; // TODO: this could cause a bug if the rootpath is the same as a regular path which is usually the language
|
||||||
$this->query = $url['query'] ?? null;
|
$this->queryString = $url['query'] ?? null;
|
||||||
$this->queryString = $this->query;
|
|
||||||
|
|
||||||
if (isset($this->query)) {
|
if (isset($this->queryString)) {
|
||||||
parse_str($this->query, $this->query);
|
parse_str($this->queryString, $this->query);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->fragment = $url['fragment'] ?? null;
|
$this->fragment = $url['fragment'] ?? null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user