Upgrade to 3.7.1
This commit is contained in:
@@ -17,31 +17,31 @@ use Kirby\Toolkit\Str;
|
||||
*/
|
||||
class Path extends Collection
|
||||
{
|
||||
public function __construct($items)
|
||||
{
|
||||
if (is_string($items) === true) {
|
||||
$items = Str::split($items, '/');
|
||||
}
|
||||
public function __construct($items)
|
||||
{
|
||||
if (is_string($items) === true) {
|
||||
$items = Str::split($items, '/');
|
||||
}
|
||||
|
||||
parent::__construct($items ?? []);
|
||||
}
|
||||
parent::__construct($items ?? []);
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->toString();
|
||||
}
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->toString();
|
||||
}
|
||||
|
||||
public function toString(bool $leadingSlash = false, bool $trailingSlash = false): string
|
||||
{
|
||||
if (empty($this->data) === true) {
|
||||
return '';
|
||||
}
|
||||
public function toString(bool $leadingSlash = false, bool $trailingSlash = false): string
|
||||
{
|
||||
if (empty($this->data) === true) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$path = implode('/', $this->data);
|
||||
$path = implode('/', $this->data);
|
||||
|
||||
$leadingSlash = $leadingSlash === true ? '/' : null;
|
||||
$trailingSlash = $trailingSlash === true ? '/' : null;
|
||||
$leadingSlash = $leadingSlash === true ? '/' : null;
|
||||
$trailingSlash = $trailingSlash === true ? '/' : null;
|
||||
|
||||
return $leadingSlash . $path . $trailingSlash;
|
||||
}
|
||||
return $leadingSlash . $path . $trailingSlash;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user