This commit is contained in:
2021-08-27 17:06:17 +08:00
parent 2f76d86069
commit daef261403
8 changed files with 62 additions and 37 deletions
+18
View File
@@ -33,6 +33,24 @@ class Uri implements UriInterface
public string $password = '';
private array $_explode = [];
/**
* @return string[]
*/
public function getExplode(): array
{
if ($this->path == '/' || $this->path == '') {
return [''];
}
if (empty($this->_explode)) {
$this->_explode = array_filter(explode('/', $this->path));
}
return $this->_explode;
}
/**
* @return string
*/