getValidTo() public méthode

public getValidTo ( ) : DateTime | null
Résultat DateTime | null
 /**
  * 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;
 }
 /**
  * Checks whether the coupon is not expired
  *
  * @return bool
  */
 protected function isNotExpired()
 {
     $now = new \DateTime();
     $couponEndDate = $this->coupon->getValidTo();
     if ($couponEndDate instanceof \DateTime) {
         return $now <= $couponEndDate;
     }
     return true;
 }