zbateson / mail-mime-parser

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

Port to PHP 7.1 #211

Closed phpfui closed 1 year ago

phpfui commented 1 year ago

Lots of changes. I put most in the final commit so you can see everything in one commit. This is a major improvement to the package and will make maintenance easier going forward.

I tried to add scalar parameter types and return types where ever possible. I did not type the object returns, as I am not that familiar with how the code should work and you may want to use a more abstract or concrete class depending on the situation. Also this can cause problems with type mismatches at run time, so you have to be careful.

I also did not change any logic where ever possible. This should be just specifying parameter and return types.

I did not resolve all PHPStan errors, as you should take a look, but I got most of them. I think the remaining issues are more judgement calls for you.

Things that should be considered going forward:

Let me know what else needs to be done / changed.

phpfui commented 1 year ago

Unit test failures are all due to dropping older versions of PHP. OK to merge.

phpfui commented 1 year ago

Should be good now, I thought I removed old PHP versions, but apparently on another branch I trashed.

zbateson commented 1 year ago

This is amazing work, thank you very much!