diff --git a/src/Checks/MinimumTimePassedCheck.php b/src/Checks/MinimumTimePassedCheck.php index 52bbeb0..5a4d5ab 100644 --- a/src/Checks/MinimumTimePassedCheck.php +++ b/src/Checks/MinimumTimePassedCheck.php @@ -9,8 +9,21 @@ class MinimumTimePassedCheck implements Check { + protected $data; + + protected function missingFromData() + { + return !$this->data->offsetExists(Honey::inputs()->getTimeOfPageLoadInputName()); + } + public function passes($data) { + $this->data = collect($data); + + if ($this->missingFromData()) { + return false; + } + $value = $data[Honey::inputs()->getTimeOfPageLoadInputName()]; return rescue(fn() => Values::timeOfPageLoad()->checkValue($value)); }