Skip to content

Commit

Permalink
feat: change returns value of setContainer() method
Browse files Browse the repository at this point in the history
BREAKING CHANGES: ContainerAware:setContainer() now returns static instead of void

Signed-off-by: Fery Wardiyanto <ferywardiyanto@gmail.com>
  • Loading branch information
feryardiant committed May 24, 2021
1 parent 3cf9636 commit 0a4dd7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Container/ContainerAware.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ interface ContainerAware
* Assign a container to the instance.
*
* @param ContainerInterface $container
* @return void
* @return static
*/
public function setContainer(ContainerInterface $container): void;
public function setContainer(ContainerInterface $container): ContainerAware;

/**
* Retrieve container instance or the instance of registered service.
Expand Down
8 changes: 5 additions & 3 deletions src/Container/HasContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ trait HasContainer
protected $container = null;

/**
* @see ContainerAwareInterface::setContainer()
* @see ContainerAware::setContainer()
*/
public function setContainer(ContainerInterface $container): void
public function setContainer(ContainerInterface $container): ContainerAware
{
$this->container = $container;

return $this;
}

/**
* @see ContainerAwareInterface::getContainer()
* @see ContainerAware::getContainer()
*/
public function getContainer(?string $name = null)
{
Expand Down

0 comments on commit 0a4dd7a

Please sign in to comment.