beberlei / assert

Thin assertion library for use in libraries and business-model
Other
2.41k stars 186 forks source link

Assertion:date fails when matching February 29th without date #336

Open rrajkomar opened 8 months ago

rrajkomar commented 8 months ago

The presence of the ! character in

$dateTime = DateTime::createFromFormat('!'.$format, $value);

causes an issue when testing without specifiying a year:

Assertion::date('29/02', 'd/m');

because the year is automatically set to 1970 and there is no 29th of February in 1970.