twilio / twilio-php

A PHP library for communicating with the Twilio REST API and generating TwiML.
MIT License
1.57k stars 562 forks source link

Incorrect type information in Twilio\Rest\Api\V2010\Account\MessageInstance #727

Closed DaveLiddament closed 1 year ago

DaveLiddament commented 2 years ago

Issue Summary

There is incorrect type information for the MessageInstance::$errorCode property.

The type hint suggests it will always be an int:

 @property int $errorCode

I'm getting TypeErrors, it seems that $errorCode can also be null.

Please can you update the docblock to the correct type:

 @property int|null $errorCode

As the use of static analysis tools is increasing it is quite important that type information is correct.

Thanks

childish-sambino commented 2 years ago

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

DaveLiddament commented 2 years ago

@childish-sambino I'm happy to provide a PR for this. Can you confirm if MessageInstance is autogenerated? I see this comment at the top which suggests it might be:

/**
 * This code was generated by
 * \ / _    _  _|   _  _
 * | (_)\/(_)(_|\/| |(/_  v1.0.0
 * /       /
 */

If it is auto generated please can you point me in the direction of how to update the source data. If it is NOT auto generated then let me know and I'll supply a fix to this file.

Thanks

childish-sambino commented 2 years ago

@DaveLiddament That header indicates it is auto-generated. Unfortunately, the generator is not open source. We will be working to migrate to an open-source generator, though.

Similar to https://github.com/twilio/twilio-node/issues/606