startDateCannotBeAfterEndDate() public static method

public static startDateCannotBeAfterEndDate ( DateTime $startDate, DateTime $endDate )
$startDate DateTime
$endDate DateTime
Example #1
0
 public function __construct(DateTime $startDate, DateTime $endDate)
 {
     if ($startDate > $endDate) {
         throw InvalidPeriod::startDateCannotBeAfterEndDate($startDate, $endDate);
     }
     $this->startDate = $startDate;
     $this->endDate = $endDate;
 }