| Total Complexity | 2 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class ErrorHandler |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Для перехвата помилок що не кидають ексепшини. |
||
| 19 | * |
||
| 20 | * @var \LogicException |
||
| 21 | */ |
||
| 22 | public static $lastError; |
||
| 23 | |||
| 24 | |||
| 25 | public static function startErrorHandle() |
||
| 26 | { |
||
| 27 | \set_error_handler([__CLASS__, 'errorHandle']); |
||
| 28 | |||
| 29 | self::$lastError = null; |
||
| 30 | } |
||
| 31 | |||
| 32 | /** @noinspection MoreThanThreeArgumentsInspection */ |
||
| 33 | /** |
||
| 34 | * @param int $messageType |
||
| 35 | * @param string $messageText |
||
| 36 | * @param string $messageFile |
||
| 37 | * @param int $messageLine |
||
| 38 | * |
||
| 39 | * @return bool |
||
| 40 | */ |
||
| 41 | public static function errorHandle(int $messageType, string $messageText, string $messageFile, int $messageLine) |
||
| 51 | } |
||
| 52 | |||
| 54 | } |