src/Domain/Value/DateTime/Date.php
protected function guardDate(int $year, int $month, int $day): void
    {
        if (!checkdate($month, $day, $year)) {
            $message = sprintf('Invalid date: %04d-%02d-%02d', $year, $month, $day);
            throw new DomainException($message);
        }
    }
protected function guardDate(int $year, int $month, int $day): void
    {
        if (!checkdate($month, $day, $year)) {
            $message = sprintf('Invalid date: %04d-%02d-%02d', $year, $month, $day);
            throw new DomainException($message);
        }
    }
protected function guardDate ( int $ year , int $ month , int $ day ) : void { if ( ! checkdate ( $ month , $ day , $ year ) ) { $ message = sprintf ( 'Invalid date: %04d-%02d-%02d' , $ year , $ month , $ day ) ; throw new DomainException ( $ message ) ; } }
Validates the date

@param int $year  The year
@param int $month The month
@param int $day   The day

@return void

@throws DomainException When the date is not valid
Validates the date