From 142114a26452c33bbd41083be308cf8a0a3d5a2e Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Tue, 26 Sep 2023 22:29:48 +0300 Subject: Implement `addError` --- src/Hird.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/Hird.php b/src/Hird.php index 956d7d6..eb96dd1 100644 --- a/src/Hird.php +++ b/src/Hird.php @@ -118,6 +118,17 @@ class Hird unset($this->validators[$ruleName]); } + /** + * 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 -- cgit v1.2.3