Update Composer packages

This commit is contained in:
Paul Nicoué 2022-12-19 14:56:05 +01:00
parent 0320235f6c
commit a8b68fb61b
378 changed files with 28466 additions and 28852 deletions

View file

@ -1,6 +1,8 @@
<?php
use Kirby\Cms\Blueprint;
use Kirby\Cms\Page;
use Kirby\Cms\Site;
use Kirby\Exception\InvalidArgumentException;
use Kirby\Toolkit\A;
use Kirby\Toolkit\I18n;
@ -53,8 +55,8 @@ return [
$parent = $this->parentModel();
if (
is_a($parent, 'Kirby\Cms\Site') === false &&
is_a($parent, 'Kirby\Cms\Page') === false
$parent instanceof Site === false &&
$parent instanceof Page === false
) {
throw new InvalidArgumentException('The parent is invalid. You must choose the site or a page as parent.');
}
@ -62,22 +64,13 @@ return [
return $parent;
},
'pages' => function () {
switch ($this->status) {
case 'draft':
$pages = $this->parent->drafts();
break;
case 'listed':
$pages = $this->parent->children()->listed();
break;
case 'published':
$pages = $this->parent->children();
break;
case 'unlisted':
$pages = $this->parent->children()->unlisted();
break;
default:
$pages = $this->parent->childrenAndDrafts();
}
$pages = match ($this->status) {
'draft' => $this->parent->drafts(),
'listed' => $this->parent->children()->listed(),
'published' => $this->parent->children(),
'unlisted' => $this->parent->children()->unlisted(),
default => $this->parent->childrenAndDrafts()
};
// filters pages that are protected and not in the templates list
// internal `filter()` method used instead of foreach loop that previously included `unset()`
@ -228,7 +221,7 @@ return [
'name' => basename($props['name']),
'title' => $props['title'],
];
} catch (Throwable $e) {
} catch (Throwable) {
$blueprints[] = [
'name' => basename($template),
'title' => ucfirst($template),