| 1 | <?php |
||
| 15 | class DrWatson extends \Exception |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var Enum |
||
| 19 | * |
||
| 20 | * You can use \BSP\DrWatson\ExceptionType or create your own Enum. |
||
| 21 | * Please visit https://github.com/myclabs/php-enum to learn how. |
||
| 22 | */ |
||
| 23 | private $type; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string |
||
| 27 | * |
||
| 28 | * This is a hint for developpers, should provide a fieldName, class::method, etc... |
||
| 29 | * It should point out the best place to start investigation. |
||
| 30 | */ |
||
| 31 | private $suspect; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var string |
||
| 35 | * |
||
| 36 | * This message is a hint meant for developpers, explaining reasons for the exception. It should be deeper and |
||
| 37 | * more precise than \BSP\DrWatson\DrWatson::$suspect, so do not hesitate to add explanation here, even if it's |
||
| 38 | * long text. |
||
| 39 | * The more details there is, the easier it will be to debug. |
||
| 40 | */ |
||
| 41 | private $help; |
||
| 42 | |||
| 43 | 1 | public function __construct( |
|
| 56 | |||
| 57 | 1 | public function type(): Enum |
|
| 61 | |||
| 62 | 1 | public function message(): string |
|
| 66 | |||
| 67 | 1 | public function suspect(): string |
|
| 71 | |||
| 72 | 1 | public function help(): string |
|
| 76 | |||
| 77 | 1 | public function code(): int |
|
| 81 | } |
||
| 82 |