Skip to content

Commit

Permalink
ServiceDefinition: added setCreator() & getCreator(), aliases for set…
Browse files Browse the repository at this point in the history
…Factory() & getFactory()
  • Loading branch information
dg committed Dec 15, 2021
1 parent 6d79ebb commit 11c236b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/DI/Definitions/ServiceDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ public function setType(?string $type)
* @return static
*/
public function setFactory($factory, array $args = [])
{
return $this->setCreator($factory, $args);
}


public function getFactory(): Statement
{
return $this->getCreator();
}


/**
* @param string|array|Definition|Reference|Statement $factory
* @return static
*/
public function setCreator($factory, array $args = [])
{
$this->factory = $factory instanceof Statement
? $factory
Expand All @@ -70,7 +86,7 @@ public function setFactory($factory, array $args = [])
}


public function getFactory(): Statement
public function getCreator(): Statement
{
return $this->factory;
}
Expand Down

0 comments on commit 11c236b

Please sign in to comment.