diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c3b3043..07d7e92c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/ServiceManager.php b/src/ServiceManager.php index 898cbc57..1f258e6d 100644 --- a/src/ServiceManager.php +++ b/src/ServiceManager.php @@ -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)) {