Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit 7feae18

Browse files
committed
Merge pull request #52 from svycka/patch-1
Fixed exception message
2 parents a78d6c4 + a965e27 commit 7feae18

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ServiceManager.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,10 @@ public function setFactory($name, $factory, $shared = null)
276276
$cName = $this->canonicalizeName($name);
277277

278278
if (!($factory instanceof FactoryInterface || is_string($factory) || is_callable($factory))) {
279-
throw new Exception\InvalidArgumentException(
280-
'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.'
281-
);
279+
throw new Exception\InvalidArgumentException(sprintf(
280+
'Provided factory must be the class name of a factory, callable or an instance of "%s".',
281+
FactoryInterface::class
282+
));
282283
}
283284

284285
if ($this->has([$cName, $name], false)) {

0 commit comments

Comments
 (0)