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

Commit b946c75

Browse files
committed
Merge branch 'feature/25' into develop
Close #25
2 parents 206cc56 + 048f561 commit b946c75

9 files changed

+29
-2
lines changed

src/Exception/ExceptionInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
use Interop\Container\Exception\ContainerException;
1313

14+
/**
15+
* Base exception for all Zend\ServiceManager exceptions.
16+
*/
1417
interface ExceptionInterface extends ContainerException
1518
{
1619
}

src/Exception/InvalidArgumentException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
use InvalidArgumentException as SplInvalidArgumentException;
1313

14+
/**
15+
* @inheritDoc
16+
*/
1417
class InvalidArgumentException extends SplInvalidArgumentException implements ExceptionInterface
1518
{
1619
}

src/Exception/ServiceNotCreatedException.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
use RuntimeException as SplRuntimeException;
1414

1515
/**
16-
* This exception is thrown when the service locator do not manage to create the service (factory that has an error...)
16+
* This exception is thrown when the service locator do not manage to create
17+
* the service (factory that has an error...)
1718
*/
1819
class ServiceNotCreatedException extends SplRuntimeException implements
1920
ContainerException,

src/Exception/ServiceNotFoundException.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
use InvalidArgumentException as SplInvalidArgumentException;
1414

1515
/**
16-
* This exception is thrown when the service locator do not manage to find a valid factory to create a service
16+
* This exception is thrown when the service locator do not manage to find a
17+
* valid factory to create a service
1718
*/
1819
class ServiceNotFoundException extends SplInvalidArgumentException implements
1920
ExceptionInterface,

src/Factory/DelegatorFactoryInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
namespace Zend\ServiceManager\Factory;
1111

1212
use Interop\Container\ContainerInterface;
13+
use Interop\Container\Exception\ContainerException;
14+
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
15+
use Zend\ServiceManager\Exception\ServiceNotFoundException;
1316

1417
/**
1518
* Delegator factory interface.
@@ -29,6 +32,10 @@ interface DelegatorFactoryInterface
2932
* @param callable $callback
3033
* @param null|array $options
3134
* @return object
35+
* @throws ServiceNotFoundException if unable to resolve the service.
36+
* @throws ServiceNotCreatedException if an exception is raised when
37+
* creating a service.
38+
* @throws ContainerException if any other error occurs
3239
*/
3340
public function __invoke(ContainerInterface $container, $name, callable $callback, array $options = null);
3441
}

src/Factory/FactoryInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
namespace Zend\ServiceManager\Factory;
1111

1212
use Interop\Container\ContainerInterface;
13+
use Interop\Container\Exception\ContainerException;
14+
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
15+
use Zend\ServiceManager\Exception\ServiceNotFoundException;
1316

1417
/**
1518
* Interface for a factory
@@ -28,6 +31,10 @@ interface FactoryInterface
2831
* @param string $requestedName
2932
* @param null|array $options
3033
* @return object
34+
* @throws ServiceNotFoundException if unable to resolve the service.
35+
* @throws ServiceNotCreatedException if an exception is raised when
36+
* creating a service.
37+
* @throws ContainerException if any other error occurs
3138
*/
3239
public function __invoke(ContainerInterface $container, $requestedName, array $options = null);
3340
}

src/PluginManagerInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace Zend\ServiceManager;
1111

12+
use Interop\Container\Exception\ContainerException;
1213
use Zend\ServiceManager\Exception\InvalidServiceException;
1314

1415
/**
@@ -25,6 +26,7 @@ interface PluginManagerInterface extends ServiceLocatorInterface
2526
* @return void
2627
* @throws InvalidServiceException If created instance does not respect the
2728
* constraint on type imposed by the plugin manager
29+
* @throws ContainerException if any other error occurs
2830
*/
2931
public function validate($instance);
3032
}

src/ServiceLocatorInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Zend\ServiceManager;
1111

1212
use Interop\Container\ContainerInterface;
13+
use Interop\Container\Exception\ContainerException;
1314
use Zend\ServiceManager\Exception;
1415

1516
/**
@@ -27,6 +28,7 @@ interface ServiceLocatorInterface extends ContainerInterface
2728
* factory could be found to create the instance.
2829
* @throws Exception\ServiceNotCreatedException If factory/delegator fails
2930
* to create the instance.
31+
* @throws ContainerException if any other error occurs
3032
*/
3133
public function build($name, array $options = null);
3234
}

src/ServiceManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ private function createDelegatorFromName($name, array $options = null)
505505
* @throws ServiceNotFoundException if unable to resolve the service.
506506
* @throws ServiceNotCreatedException if an exception is raised when
507507
* creating a service.
508+
* @throws ContainerException if any other error occurs
508509
*/
509510
private function doCreate($resolvedName, array $options = null)
510511
{

0 commit comments

Comments
 (0)