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

Commit f337d4b

Browse files
committed
Merge branch 'hotfix/52'
Close #52
2 parents a78d6c4 + 5392879 commit f337d4b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ All notable changes to this project will be documented in this file, in reverse
2424
the exception hierarchy to inherit from the container-interop exceptions.
2525
This ensures that all exceptions thrown by the component follow the
2626
recommendations of that project.
27+
- [#52](https://github.com/zendframework/zend-servicemanager/pull/52) fixes
28+
the exception message thrown by `ServiceManager::setFactory()` to remove
29+
references to abstract factories.
2730

2831
## 2.6.0 - 2015-07-23
2932

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)