|
8 | 8 | namespace Zend\ServiceManager\Exception;
|
9 | 9 |
|
10 | 10 | use InvalidArgumentException as SplInvalidArgumentException;
|
11 |
| -use Zend\ServiceManager\Initializer\InitializerInterface; |
12 | 11 | use Zend\ServiceManager\AbstractFactoryInterface;
|
| 12 | +use Zend\ServiceManager\Initializer\InitializerInterface; |
13 | 13 |
|
14 | 14 | /**
|
15 | 15 | * @inheritDoc
|
16 | 16 | */
|
17 | 17 | class InvalidArgumentException extends SplInvalidArgumentException implements ExceptionInterface
|
18 | 18 | {
|
| 19 | + /** |
| 20 | + * @param mixed $initializer |
| 21 | + * @return self |
| 22 | + */ |
19 | 23 | public static function fromInvalidInitializer($initializer)
|
20 | 24 | {
|
21 | 25 | return new self(sprintf(
|
22 |
| - 'An invalid initializer was registered. Expected a callable, or an instance of ' |
23 |
| - . '(or valid class name or function name resolving to) "%s", ' |
24 |
| - . 'but "%s" was received', |
| 26 | + 'An invalid initializer was registered. Expected a callable or an' |
| 27 | + . ' instance of "%s"; received "%s"', |
25 | 28 | InitializerInterface::class,
|
26 | 29 | is_object($initializer) ? get_class($initializer) : gettype($initializer)
|
27 | 30 | ));
|
28 | 31 | }
|
29 | 32 |
|
| 33 | + /** |
| 34 | + * @param mixed $abstractFactory |
| 35 | + * @return self |
| 36 | + */ |
30 | 37 | public static function fromInvalidAbstractFactory($abstractFactory)
|
31 | 38 | {
|
32 | 39 | return new self(sprintf(
|
33 |
| - 'An invalid abstract factory was registered. Expected an instance of or a ' |
34 |
| - . 'valid class name resolving to an implementation of "%s", but "%s" was received.', |
| 40 | + 'An invalid abstract factory was registered. Expected an instance of or a valid' |
| 41 | + . ' class name resolving to an implementation of "%s", but "%s" was received.', |
35 | 42 | AbstractFactoryInterface::class,
|
36 | 43 | is_object($abstractFactory) ? get_class($abstractFactory) : gettype($abstractFactory)
|
37 | 44 | ));
|
|
0 commit comments