Skip to content

Commit

Permalink
added PHP 8 typehints
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 8, 2023
1 parent 11a63f1 commit 0a42100
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/ComponentModel/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/ComponentModel/IComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 0a42100

Please sign in to comment.