florianv / exchanger

:office: Currency exchange rates framework for PHP

Home Page:https://florianv.github.io/exchanger/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] UnsupportedDateException::getDate() throws a TypeError

andrei-livadariu opened this issue · comments

Project Version: 2.7.1
PHP Version: 7.4.4

Calling the getDate() method on an UnsupportedDateException object always throws a TypeError.

This seems to happen because the $date property never receives a value in the constructor, so it stays null. Since the getDate() method is type hinted, this casues the TypeError.

The fix may be as easy as setting the $date property, but I'm not sure of the design intention.

As a side note, thank you for this wonderful project! Just found it today and it feels like I've been looking for it all my life 😄

Hey @andrei-livadariu, thanks for the detailed report!

Just sent a commit to fix it.