smsapi / smsapi-php-client

SMSAPI PHP client that allows you to send messages, manage Short URLs and administrate your SMSAPI account.
https://www.smsapi.pl
Other
64 stars 39 forks source link

DateTime::__construct() expects parameter 1 to be string, null given #91

Closed dudzio12 closed 3 years ago

dudzio12 commented 4 years ago

DateTime::__construct() expects parameter 1 to be string, null given

inside \Smsapi\Client\Feature\Sms\Sendernames\Data\SendernameFactory:18

When $object->created_at is null, an exception is thrown.

I'm actually using this package as a part of Magento integration module.

An easy fix is to check if created_at is not empty before using it as argument for DateTime object. I can make PR if you want to fix it that way and not by implementing changes inside Magento integration extension.

maciejlew commented 3 years ago

This issue was solved on API side.