Skip to content

Commit 3803a55

Browse files
committed
ServiceDefinition: added setCreator() & getCreator(), aliases for setFactory() & getFactory()
1 parent 2d40a61 commit 3803a55

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/DI/Definitions/ServiceDefinition.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,22 @@ public function setType(?string $type)
6262
* @return static
6363
*/
6464
public function setFactory($factory, array $args = [])
65+
{
66+
return $this->setCreator($factory, $args);
67+
}
68+
69+
70+
public function getFactory(): Statement
71+
{
72+
return $this->getCreator();
73+
}
74+
75+
76+
/**
77+
* @param string|array|Definition|Reference|Statement $factory
78+
* @return static
79+
*/
80+
public function setCreator($factory, array $args = [])
6581
{
6682
$this->factory = $factory instanceof Statement
6783
? $factory
@@ -70,7 +86,7 @@ public function setFactory($factory, array $args = [])
7086
}
7187

7288

73-
public function getFactory(): Statement
89+
public function getCreator(): Statement
7490
{
7591
return $this->factory;
7692
}

0 commit comments

Comments
 (0)