Upgrade to 3.6.1

This commit is contained in:
Bastian Allgeier
2021-12-07 12:39:37 +01:00
parent 9fc43ea22c
commit 70b8439c49
134 changed files with 19987 additions and 1100 deletions

View File

@@ -6,6 +6,7 @@ use Kirby\Filesystem\F;
use Kirby\Filesystem\IsFile;
use Kirby\Panel\File as Panel;
use Kirby\Toolkit\A;
use Kirby\Toolkit\Str;
/**
* The `$file` object provides a set
@@ -362,14 +363,9 @@ class File extends ModelWithContent
$file = $this->modifiedFile();
$content = $this->modifiedContent($languageCode);
$modified = max($file, $content);
$handler ??= $this->kirby()->option('date.handler', 'date');
if (is_null($format) === true) {
return $modified;
}
$handler = $handler ?? $this->kirby()->option('date.handler', 'date');
return $handler($format, $modified);
return Str::date($modified, $format, $handler);
}
/**
@@ -422,7 +418,7 @@ class File extends ModelWithContent
*/
public function parent()
{
return $this->parent = $this->parent ?? $this->kirby()->site();
return $this->parent ??= $this->kirby()->site();
}
/**
@@ -472,7 +468,7 @@ class File extends ModelWithContent
*/
public function root(): ?string
{
return $this->root = $this->root ?? $this->parent()->root() . '/' . $this->filename();
return $this->root ??= $this->parent()->root() . '/' . $this->filename();
}
/**
@@ -598,7 +594,7 @@ class File extends ModelWithContent
*/
public function template(): ?string
{
return $this->template = $this->template ?? $this->content()->get('template')->value();
return $this->template ??= $this->content()->get('template')->value();
}
/**
@@ -631,7 +627,7 @@ class File extends ModelWithContent
*/
public function url(): string
{
return $this->url ?? $this->url = ($this->kirby()->component('file::url'))($this->kirby(), $this);
return $this->url ??= ($this->kirby()->component('file::url'))($this->kirby(), $this);
}