mail-mime-parser
mail-mime-parser copied to clipboard
Fixing union type syntax
Psalm was giving me:
ERROR: UndefinedMethod - ... - Method ZBateson\MailMimeParser\Header\AbstractHeader::getDateTimeImmutable does not exist (see https://psalm.dev/022)
on
$message->getHeader('date')->getDateTimeImmutable()
It looks like line breaks aren't allowed here, even though it's not explicitly documented at https://psalm.dev/docs/annotating_code/type_syntax/union_types/
Anyway - in PHP8 this line will become the very return type - so sooner or later it would have to be shortened by using use anyway ;-)