From 2fa0652239327984b349a6ade9fad35dcc3e1a7c Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sun, 12 Dec 2021 18:50:13 +0100 Subject: [PATCH] added PHP 8 typehints --- src/ComponentModel/Component.php | 3 +-- src/ComponentModel/IComponent.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ComponentModel/Component.php b/src/ComponentModel/Component.php index 6de545c..b3af3df 100644 --- a/src/ComponentModel/Component.php +++ b/src/ComponentModel/Component.php @@ -157,11 +157,10 @@ final public function getParent(): ?IContainer /** * Sets or removes the parent of this component. This method is managed by containers and should * not be called by applications - * @return static * @throws Nette\InvalidStateException * @internal */ - public function setParent(?IContainer $parent, ?string $name = null) + public function setParent(?IContainer $parent, ?string $name = null): static { if ($parent === null && $this->parent === null && $name !== null) { $this->name = $name; // just rename diff --git a/src/ComponentModel/IComponent.php b/src/ComponentModel/IComponent.php index 4c02f92..eb21c97 100644 --- a/src/ComponentModel/IComponent.php +++ b/src/ComponentModel/IComponent.php @@ -30,7 +30,6 @@ function getParent(): ?IContainer; /** * Sets the parent of this component. - * @return static */ - function setParent(?IContainer $parent, ?string $name = null); + function setParent(?IContainer $parent, ?string $name = null): static; }