| 1 | <?php |
||
| 16 | class ErrorHandler |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * Error log |
||
| 20 | * @var string[] |
||
| 21 | */ |
||
| 22 | protected $log = []; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * ErrorHandler constructor. |
||
| 26 | */ |
||
| 27 | public function __construct() |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Callback |
||
| 33 | * |
||
| 34 | * @param int $no |
||
| 35 | * @param string $str |
||
| 36 | * @param string $file |
||
| 37 | * @param int $line |
||
| 38 | * @param array $context |
||
| 39 | * @return bool |
||
| 40 | */ |
||
| 41 | public function callback($no, $str, $file = '', $line = 0, $context = []) |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Handle |
||
| 55 | * |
||
| 56 | * @return bool |
||
| 57 | */ |
||
| 58 | private function handle() |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Last error as string |
||
| 68 | * |
||
| 69 | * @return array|false |
||
| 70 | */ |
||
| 71 | public function getLast() |
||
| 75 | } |
||
| 76 |