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
MissingHandlerException.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | namespace League\Tactician\Exception; |
| 4 | |
| 5 | /** |
| 6 | * No handler could be found for the given command. |
| 7 | */ |
| 8 | class MissingHandlerException extends \OutOfBoundsException implements Exception |
| 9 | { |
| 10 | /** |
| 11 | * @var string |
| 12 | */ |
| 13 | private $commandName; |
| 14 | |
| 15 | /** |
| 16 | * @param string $commandName |
| 17 | * |
| 18 | * @return static |
| 19 | */ |
| 20 | public static function forCommand($commandName) |
| 21 | { |
| 22 | $exception = new static('Missing handler for command ' . $commandName); |
| 23 | $exception->commandName = $commandName; |
| 24 | |
| 25 | return $exception; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * @return string |
| 30 | */ |
| 31 | public function getCommandName() |
| 32 | { |
| 33 | return $this->commandName; |
| 34 | } |
| 35 | } |
| 36 |