zbateson / mail-mime-parser

An email parser written in PHP
https://mail-mime-parser.org/
BSD 2-Clause "Simplified" License
442 stars 56 forks source link

Return types mismatch (AddressHeader::getEmail) #187

Closed rskrzypczak closed 1 year ago

rskrzypczak commented 2 years ago

A trivial thing, but it causes confusion :) https://github.com/zbateson/mail-mime-parser/blob/dd3fafea57ed8b0daca57ed95ed0eda81fe14a7d/src/Header/AddressHeader.php#L107-L115

https://github.com/zbateson/mail-mime-parser/blob/dd3fafea57ed8b0daca57ed95ed0eda81fe14a7d/src/Header/AbstractHeader.php#L82-L88

string, null? can this by more strict and consistent?

zbateson commented 2 years ago

@rskrzypczak -- what do you propose? Looks to me like getEmail needs to be string|null. Feel free to go through it and submit pull requests where you find inconsistencies.