| Total Complexity | 6 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 12 | class ErrorCatcher |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var null|array |
||
| 16 | */ |
||
| 17 | private $last; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var null|array |
||
| 21 | */ |
||
| 22 | private $previous; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var int |
||
| 26 | */ |
||
| 27 | private $level; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return ErrorCatcher |
||
| 31 | */ |
||
| 32 | 1 | public static function create() |
|
| 33 | { |
||
| 34 | 1 | return new self(); |
|
| 35 | } |
||
| 36 | |||
| 37 | 3 | public function __construct() |
|
| 38 | { |
||
| 39 | 3 | $this->start(); |
|
| 40 | 3 | } |
|
| 41 | |||
| 42 | /** |
||
| 43 | * @return bool an error occurred between start and end |
||
| 44 | */ |
||
| 45 | 2 | public function end() |
|
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return null|string |
||
| 56 | */ |
||
| 57 | 2 | public function getLastErrorMessage() |
|
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * start catching session (is auto-started on create) |
||
| 66 | * |
||
| 67 | * @return void |
||
| 68 | */ |
||
| 69 | 3 | private function start() |
|
| 77 |