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

Commit f4942fd

Browse files
committed
Updated exception - all library exceptions extend ExceptionInterface
1 parent 37d67f6 commit f4942fd

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/Exception/ServiceNotCreatedException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77

88
namespace Zend\ServiceManager\Exception;
99

10-
use Psr\Container\ContainerExceptionInterface;
1110
use RuntimeException as SplRuntimeException;
1211

1312
/**
1413
* This exception is thrown when the service locator do not manage to create
1514
* the service (factory that has an error...)
1615
*/
17-
class ServiceNotCreatedException extends SplRuntimeException implements ContainerExceptionInterface
16+
class ServiceNotCreatedException extends SplRuntimeException implements ExceptionInterface
1817
{
1918
}

src/Exception/ServiceNotFoundException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
namespace Zend\ServiceManager\Exception;
99

1010
use InvalidArgumentException as SplInvalidArgumentException;
11-
use Psr\Container\ContainerExceptionInterface;
1211

1312
/**
1413
* This exception is thrown when the service locator do not manage to find a
1514
* valid factory to create a service
1615
*/
17-
class ServiceNotFoundException extends SplInvalidArgumentException implements ContainerExceptionInterface
16+
class ServiceNotFoundException extends SplInvalidArgumentException implements ExceptionInterface
1817
{
1918
}

src/ServiceManager.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Psr\Container\ContainerInterface;
1818
use Zend\ServiceManager\Exception\ContainerModificationsNotAllowedException;
1919
use Zend\ServiceManager\Exception\CyclicAliasException;
20+
use Zend\ServiceManager\Exception\ExceptionInterface;
2021
use Zend\ServiceManager\Exception\InvalidArgumentException;
2122
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
2223
use Zend\ServiceManager\Exception\ServiceNotFoundException;
@@ -658,7 +659,7 @@ private function createDelegatorFromName($name, array $options = null)
658659
* @throws ServiceNotFoundException if unable to resolve the service.
659660
* @throws ServiceNotCreatedException if an exception is raised when
660661
* creating a service.
661-
* @throws ContainerExceptionInterface|Exception if any other error occurs
662+
* @throws ExceptionInterface if any other error occurs
662663
*/
663664
private function doCreate($resolvedName, array $options = null)
664665
{
@@ -670,7 +671,7 @@ private function doCreate($resolvedName, array $options = null)
670671
} else {
671672
$object = $this->createDelegatorFromName($resolvedName, $options);
672673
}
673-
} catch (ContainerExceptionInterface $exception) {
674+
} catch (ExceptionInterface $exception) {
674675
throw $exception;
675676
} catch (Exception $exception) {
676677
throw new ServiceNotCreatedException(sprintf(

0 commit comments

Comments
 (0)