PluginProbe
WPIDE – File Manager & Code Editor / 3.5.9
WPIDE – File Manager & Code Editor v3.5.9
3.5.9 3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 All 55 releases
wpide / vendor / nikic / php-parser / lib / PhpParser / ErrorHandler / Collecting.php

Collecting.php in WPIDE – File Manager & Code Editor 3.5.9, at vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php

47 lines 880 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php declare(strict_types=1);
2
3 namespace PhpParser\ErrorHandler;
4
5 use PhpParser\Error;
6 use PhpParser\ErrorHandler;
7
8 /**
9 * Error handler that collects all errors into an array.
10 *
11 * This allows graceful handling of errors.
12 */
13 class Collecting implements ErrorHandler
14 {
15 /** @var Error[] Collected errors */
16 private $errors = [];
17
18 public function handleError(Error $error) {
19 $this->errors[] = $error;
20 }
21
22 /**
23 * Get collected errors.
24 *
25 * @return Error[]
26 */
27 public function getErrors() : array {
28 return $this->errors;
29 }
30
31 /**
32 * Check whether there are any errors.
33 *
34 * @return bool
35 */
36 public function hasErrors() : bool {
37 return !empty($this->errors);
38 }
39
40 /**
41 * Reset/clear collected errors.
42 */
43 public function clearErrors() {
44 $this->errors = [];
45 }
46 }
47