Skip to content

Commit

Permalink
Merge pull request #60 from AntonioJABV/main
Browse files Browse the repository at this point in the history
fix: 🐛 fixed undefined array key "honey_time" error
  • Loading branch information
lukeraymonddowning authored Feb 3, 2023
2 parents 7fbc6bd + b4232ed commit 8a29ad6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Checks/MinimumTimePassedCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 8a29ad6

Please sign in to comment.