/**
* Checks whether the coupon is not expired
*
* @param CouponInterface $coupon
*
* @return bool
*/
private function isNotExpired(CouponInterface $coupon) : bool
{
$now = new \DateTime();
$couponEndDate = $coupon->getValidTo();
if ($couponEndDate instanceof \DateTime) {
return $now <= $couponEndDate;
}
return true;
}