PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.8.0
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.8.0
4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.5.2 All 199 releases
betterdocs / includes / Dependencies / PhpParser / ErrorHandler / Collecting.php

Collecting.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.8.0, at includes/Dependencies/PhpParser/ErrorHandler/Collecting.php

46 lines 947 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPDeveloper\BetterDocs\Dependencies\PhpParser\ErrorHandler;
4
5 use WPDeveloper\BetterDocs\Dependencies\PhpParser\Error;
6 use WPDeveloper\BetterDocs\Dependencies\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() {
28 return $this->errors;
29 }
30
31 /**
32 * Check whether there are any errors.
33 *
34 * @return bool
35 */
36 public function hasErrors() {
37 return !empty($this->errors);
38 }
39
40 /**
41 * Reset/clear collected errors.
42 */
43 public function clearErrors() {
44 $this->errors = [];
45 }
46 }