Upgrade to 3.7.1

This commit is contained in:
Bastian Allgeier
2022-07-12 13:33:21 +02:00
parent 7931eb5e47
commit 1ad1eaf387
377 changed files with 63981 additions and 63824 deletions

View File

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