Skip to content

Commit 48baaad

Browse files
committed
Container::addComponent() added typehint
1 parent d75bbc0 commit 48baaad

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
@@ -30,10 +30,9 @@ class Container extends Component implements IContainer
3030

3131
/**
3232
* Adds a child component to the container.
33-
* @return static
3433
* @throws Nette\InvalidStateException
3534
*/
36-
public function addComponent(IComponent $component, ?string $name, ?string $insertBefore = null)
35+
public function addComponent(IComponent $component, ?string $name, ?string $insertBefore = null): static
3736
{
3837
if ($name === null) {
3938
$name = $component->getName();

src/ComponentModel/IContainer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ interface IContainer extends IComponent
1919
{
2020
/**
2121
* Adds the component to the container.
22-
* @return static
2322
*/
24-
function addComponent(IComponent $component, ?string $name);
23+
function addComponent(IComponent $component, ?string $name): static;
2524

2625
/**
2726
* Removes the component from the container.

0 commit comments

Comments
 (0)