diff --git a/src/ComponentModel/Container.php b/src/ComponentModel/Container.php index fcc49c3..570caee 100644 --- a/src/ComponentModel/Container.php +++ b/src/ComponentModel/Container.php @@ -33,10 +33,9 @@ class Container extends Component implements IContainer /** * Adds the component to the container. - * @return static * @throws Nette\InvalidStateException */ - public function addComponent(IComponent $component, ?string $name, ?string $insertBefore = null) + public function addComponent(IComponent $component, ?string $name, ?string $insertBefore = null): static { if ($name === null) { $name = $component->getName(); diff --git a/src/ComponentModel/IContainer.php b/src/ComponentModel/IContainer.php index 0fe2893..22ff729 100644 --- a/src/ComponentModel/IContainer.php +++ b/src/ComponentModel/IContainer.php @@ -21,9 +21,8 @@ interface IContainer extends IComponent /** * Adds the component to the container. * @param T $component - * @return static */ - function addComponent(IComponent $component, ?string $name); + function addComponent(IComponent $component, ?string $name): static; /** * Removes the component from the container.