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

Commit

Permalink
Merge branch 'hotfix/52'
Browse files Browse the repository at this point in the history
Close #52
  • Loading branch information
weierophinney committed Jan 11, 2016
2 parents a78d6c4 + 5392879 commit f337d4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ All notable changes to this project will be documented in this file, in reverse
the exception hierarchy to inherit from the container-interop exceptions.
This ensures that all exceptions thrown by the component follow the
recommendations of that project.
- [#52](https://github.com/zendframework/zend-servicemanager/pull/52) fixes
the exception message thrown by `ServiceManager::setFactory()` to remove
references to abstract factories.

## 2.6.0 - 2015-07-23

Expand Down
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

0 comments on commit f337d4b

Please sign in to comment.