Skip to content

Commit 331fcaa

Browse files
committed
Container::addComponent() added typehint
1 parent b9bf3b0 commit 331fcaa

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/ComponentModel/Container.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ class Container extends Component implements IContainer
3333

3434
/**
3535
* Adds a child component to the container.
36-
* @return static
3736
* @throws Nette\InvalidStateException
3837
*/
39-
public function addComponent(IComponent $component, ?string $name, ?string $insertBefore = null)
38+
public function addComponent(IComponent $component, ?string $name, ?string $insertBefore = null): static
4039
{
4140
if ($name === null) {
4241
$name = $component->getName();

src/ComponentModel/IContainer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ interface IContainer extends IComponent
2121
/**
2222
* Adds the component to the container.
2323
* @param T $component
24-
* @return static
2524
*/
26-
function addComponent(IComponent $component, ?string $name);
25+
function addComponent(IComponent $component, ?string $name): static;
2726

2827
/**
2928
* Removes the component from the container.

0 commit comments

Comments
 (0)