Total Complexity | 4 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 87.5% |
Changes | 0 |
1 | <?php |
||
12 | class Core |
||
13 | { |
||
14 | /** |
||
15 | * Whether errors should throw exceptions or just be stored. |
||
16 | * |
||
17 | * @see static::$errors |
||
18 | * |
||
19 | * @var bool |
||
20 | */ |
||
21 | public $strict = false; |
||
22 | |||
23 | /** |
||
24 | * List of errors that occurred during lexing. |
||
25 | * |
||
26 | * Usually, the lexing does not stop once an error occurred because that |
||
27 | * error might be false positive or a partial result (even a bad one) |
||
28 | * might be needed. |
||
29 | * |
||
30 | * @see Core::error() |
||
31 | * |
||
32 | * @var Exception[] |
||
33 | */ |
||
34 | public $errors = []; |
||
35 | |||
36 | 1320 | public function __construct() |
|
43 | } |
||
44 | |||
45 | /** |
||
46 | * Creates a new error log. |
||
47 | * |
||
48 | * @param Exception $error the error exception |
||
49 | * |
||
50 | * @return void |
||
51 | * |
||
52 | * @throws Exception throws the exception, if strict mode is enabled. |
||
53 | */ |
||
54 | 316 | public function error($error) |
|
63 |