From 4103c8bd40a6b19296c41b8ac6571fd34ce95108 Mon Sep 17 00:00:00 2001 From: Julius Ijie Date: Fri, 23 Feb 2018 15:59:30 +0100 Subject: [PATCH] Forced stopOnFirstFail parameter to bool --- src/Valitron/Validator.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Valitron/Validator.php b/src/Valitron/Validator.php index 74e41c6..d9fe2f7 100644 --- a/src/Valitron/Validator.php +++ b/src/Valitron/Validator.php @@ -1021,9 +1021,8 @@ class Validator * Should the validation stop a rule is failed * @param bool $stop */ - public function stopOnFirstFail($stop) { - if(!is_bool($stop)) throw new \InvalidArgumentException('Parameter of type boolean expected'); - $this->stop_on_first_fail = $stop; + public function stopOnFirstFail($stop = true) { + $this->stop_on_first_fail = (bool) $stop; } /**