Skip to content

Commit

Permalink
Container::addComponent() added typehint
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 7, 2024
1 parent d420a52 commit b85d242
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/ComponentModel/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ class Container extends Component implements IContainer

/**
* Adds a child 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();
Expand Down
3 changes: 1 addition & 2 deletions src/ComponentModel/IContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b85d242

Please sign in to comment.