Skip to content

Commit

Permalink
fix: 🐛 fixed undefined array key "honey_time" error
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniApps committed Jun 27, 2022
1 parent 7fbc6bd commit b4232ed
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 b4232ed

Please sign in to comment.