byrokrat/id

Throw exception when using unvalid dates

Closed this issue · 0 comments

Unvalid dates are automatically transform by DateTime. We should throw an Exception instead.

$id = new PersonalId('001301-0004');
echo $id->format('ymd');
// prints 010101
// should throw exception since 13 is not a valid month