-
Notifications
You must be signed in to change notification settings - Fork 94
Description
I believe 1.19.1, which featured #103 should not be released as a minor change, but rather in a new major version release, as it's not backwards compatible:
- Since the types changed, all code using recipients as arrays broke.
Previously, this worked fine:
$messageBirdMessage->recipients = [$number];
But that now breaks.
2. The Recipient
class defines the $recipient
property as integer (https://github.com/messagebird/php-rest-api/blob/master/src/MessageBird/Objects/Recipient.php#L16), while that formerly accepted a string, which can still be seen in the examples (https://github.com/messagebird/php-rest-api/blob/master/examples/message-create.php#L9). The original documentation also shows that string values are allowed (https://developers.messagebird.com/quickstarts/sms/send-sms-curl/), so why this changed is unclear. This doesn't break code as much, as it's not strictly enforced by the compiler, but does break PHPStan checking my code.
3. Examples have not been updated, so documentation is now very confusing for new users.
All-in-all, I think the best course of action now would be to:
- Revert the changes in 1.19.1, releasing 1.19.2 as a fix
- Fix the documentation, examples and types
- Release 2.0 with this change again