mail-mime-parser icon indicating copy to clipboard operation
mail-mime-parser copied to clipboard

Fixing union type syntax

Open ThomasLandauer opened this issue 4 years ago • 0 comments

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 ;-)

ThomasLandauer avatar Feb 15 '21 21:02 ThomasLandauer