Upgrade to 4.0.0

This commit is contained in:
Bastian Allgeier
2023-11-28 09:33:56 +01:00
parent f96b96af76
commit 3b0b6546ca
480 changed files with 21371 additions and 13327 deletions

View File

@@ -23,14 +23,12 @@ trait SiteActions
* 3. commits the store action
* 4. sends the after hook
* 5. returns the result
*
* @param string $action
* @param mixed ...$arguments
* @param Closure $callback
* @return mixed
*/
protected function commit(string $action, array $arguments, Closure $callback)
{
protected function commit(
string $action,
array $arguments,
Closure $callback
): mixed {
$old = $this->hardcopy();
$kirby = $this->kirby();
$argumentValues = array_values($arguments);
@@ -48,14 +46,12 @@ trait SiteActions
/**
* Change the site title
*
* @param string $title
* @param string|null $languageCode
* @return static
*/
public function changeTitle(string $title, string $languageCode = null)
{
$site = $this;
public function changeTitle(
string $title,
string $languageCode = null
): static {
$site = $this;
$title = trim($title);
$arguments = compact('site', 'title', 'languageCode');
@@ -66,11 +62,8 @@ trait SiteActions
/**
* Creates a main page
*
* @param array $props
* @return \Kirby\Cms\Page
*/
public function createChild(array $props)
public function createChild(array $props): Page
{
$props = array_merge($props, [
'url' => null,
@@ -87,14 +80,16 @@ trait SiteActions
*
* @return $this
*/
public function purge()
public function purge(): static
{
$this->blueprint = null;
$this->children = null;
$this->content = null;
$this->files = null;
$this->inventory = null;
$this->translations = null;
parent::purge();
$this->blueprint = null;
$this->children = null;
$this->childrenAndDrafts = null;
$this->drafts = null;
$this->files = null;
$this->inventory = null;
return $this;
}