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

Fixed exception message #52

Merged
merged 1 commit into from
Jan 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/ServiceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,10 @@ public function setFactory($name, $factory, $shared = null)
$cName = $this->canonicalizeName($name);

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

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