| 1 | <?php |
||
| 7 | class CommandException extends RuntimeException |
||
| 8 | { |
||
| 9 | const NO_OPTIONS = 2000; |
||
| 10 | const MISSING_OPTION = 2000; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @param Command $command |
||
| 14 | * |
||
| 15 | * @return static |
||
| 16 | * |
||
| 17 | * @since 1.3.0 |
||
| 18 | */ |
||
| 19 | 1 | public static function needsOptions(Command $command) |
|
| 26 | |||
| 27 | /* |
||
| 28 | * @param array $names |
||
| 29 | * |
||
| 30 | * @return static |
||
| 31 | * |
||
| 32 | * @since 1.2.0 |
||
| 33 | */ |
||
| 34 | 2 | public static function missingOptions(array $names) |
|
| 41 | |||
| 42 | /** |
||
| 43 | * @param string $name |
||
| 44 | * |
||
| 45 | * @return static |
||
| 46 | * |
||
| 47 | * @deprecated 1.2.0 |
||
| 48 | */ |
||
| 49 | 1 | public static function missingOption($name) |
|
| 50 | { |
||
| 51 | 1 | return new static( |
|
| 52 | 1 | sprintf('Required option `%s` is not defined', $name), |
|
| 53 | static::MISSING_OPTION |
||
| 54 | 1 | ); |
|
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Get the HTTP status for the exception. |
||
| 59 | * |
||
| 60 | * @return integer |
||
| 61 | */ |
||
| 62 | 2 | public function getHttpStatus() |
|
| 70 | } |
||
| 71 |