CanNotDetermineCommandNameException.php
7 years ago
CanNotInvokeHandlerException.php
7 years ago
Exception.php
7 years ago
InvalidCommandException.php
7 years ago
InvalidMiddlewareException.php
7 years ago
MissingHandlerException.php
7 years ago
InvalidMiddlewareException.php
20 lines
| 1 | <?php |
| 2 | |
| 3 | namespace League\Tactician\Exception; |
| 4 | |
| 5 | /** |
| 6 | * Thrown when the CommandBus was instantiated with an invalid middleware object |
| 7 | */ |
| 8 | class InvalidMiddlewareException extends \InvalidArgumentException implements Exception |
| 9 | { |
| 10 | public static function forMiddleware($middleware) |
| 11 | { |
| 12 | $name = is_object($middleware) ? get_class($middleware) : gettype($middleware); |
| 13 | $message = sprintf( |
| 14 | 'Cannot add "%s" to middleware chain as it does not implement the Middleware interface.', |
| 15 | $name |
| 16 | ); |
| 17 | return new static($message); |
| 18 | } |
| 19 | } |
| 20 |