1 | <?php |
||
15 | final 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 | private function __construct( |
|
56 | |||
57 | /** |
||
58 | * Named Constructor. DrWatson writes a fine report for you ! |
||
59 | */ |
||
60 | 1 | public static function report( |
|
70 | |||
71 | 1 | public function type(): Enum |
|
75 | |||
76 | 1 | public function message(): string |
|
80 | |||
81 | 1 | public function suspect(): string |
|
85 | |||
86 | 1 | public function help(): string |
|
90 | |||
91 | 1 | public function code(): int |
|
95 | } |
||
96 |