fastbill / fastbill-php-sdk

php sdk for the api of https://www.fastbill.com/
https://apidocs.fastbill.com/
MIT License
24 stars 14 forks source link

InvoiceSearchStruct()->setStartDueDate() expects \DateTime but fails. #4

Closed chluehr closed 5 years ago

chluehr commented 5 years ago

Sample Code:

$invoiceSearchStruct = new InvoiceSearchStruct(); $invoiceSearchStruct->setStartDueDate(new \DateTime('2018-12-01'));

Results in Error:

In XmlService.php line 85: Catchable Fatal Error: Object of class DateTime could not be converted to string

Using Carbon it works:

$invoiceSearchStruct = new InvoiceSearchStruct(); $invoiceSearchStruct->setStartDueDate(new Carbon('2018-12-01'));

teiling88 commented 5 years ago

Oh good catch - the type hinting was not correct. At the moment I need directly the correct Date value as a string. I fixed it for the moment with this commit