summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAsko Nõmm <asko@repl.ee>2023-09-26 22:29:48 +0300
committerAsko Nõmm <asko@repl.ee>2023-09-26 22:29:48 +0300
commit142114a26452c33bbd41083be308cf8a0a3d5a2e (patch)
tree4156451e3b26240b9fa629c2c6b875467753de97 /src
parent641826a5a408b00a6adb04847d178925bbe0e574 (diff)
Implement `addError`
Diffstat (limited to 'src')
-rw-r--r--src/Hird.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Hird.php b/src/Hird.php
index 956d7d6..eb96dd1 100644
--- a/src/Hird.php
+++ b/src/Hird.php
@@ -119,6 +119,17 @@ class Hird
}
/**
+ * Manually adds an error.
+ *
+ * @param string $error
+ * @return void
+ */
+ public function addError(string $error): void
+ {
+ $this->errors[] = $error;
+ }
+
+ /**
* Runs `$this->rules` over `$this->fields` to construct
* potential errors that will be stored as an array of strings
* in `$this->errors`.