diff options
| author | Asko Nomm <asko@bien.ee> | 2022-02-27 21:07:52 +0100 |
|---|---|---|
| committer | Asko Nomm <asko@bien.ee> | 2022-02-27 21:07:52 +0100 |
| commit | dbacaf305b8f4a5792e3d327d3ba98ecf06b04e0 (patch) | |
| tree | cdebe595e145a74653236150d7425ba640bc4a8f /src/Hird.php | |
| parent | 96bef73aa85e49e821328d162e963f80e675fa35 (diff) | |
Validate in fails(), not in constructor
Because otherwise we won't have the ability to register new validators.
Diffstat (limited to 'src/Hird.php')
| -rw-r--r-- | src/Hird.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Hird.php b/src/Hird.php index 1671619..305356c 100644 --- a/src/Hird.php +++ b/src/Hird.php @@ -52,7 +52,6 @@ class Hird private array $rules, ) { $this->registerDefaultValidators(); - $this->validate(); } /** @@ -126,6 +125,8 @@ class Hird */ public function fails(): bool { + $this->validate(); + return count($this->errors) !== 0; } |
