-
Notifications
You must be signed in to change notification settings - Fork 563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 8.4 deprecation "Implicitly marking parameter as nullable" #835
Comments
same issue |
Hey, guys. Any updates? |
Thanks, I hadn't seen that PR - would be great to get this committed. |
i see there are few PRs merged to fix this deprecation warning, but I think it's not fixed completely as I still get deprecation warning on version 8.3.12. for example, this line of code triggers deprecation: https://github.com/twilio/twilio-php/blob/main/src/Twilio/Rest/Chat/V1/ServiceList.php#L85 |
Yes, there are still generated files that don't properly type nullable parameters. This library is generated with https://openapi-generator.tech, and that will need to support PHP 8.4. So if we can that fixed, the generator will automatically fix this library. But the big issue here is https://openapi-generator.tech has LOTS of PRs, and still not one to support PHP 8.4 I am thinking running Rector on my version of the code base. I check in the source to me local repo so I don't reply on composer to install files. It may be possible to add a rector step to post process this library until https://openapi-generator.tech adds PHP 8.4 support. I will keep everyone posted. |
So no need for Rector. PHP-CS-Fixer will do the work needed. I will submit a PR for this next week to add this to the CI pipeline. Basically: $config = new PhpCsFixer\Config();
$config->setRules(['nullable_type_declaration_for_default_null_value' => true,]);
return $config->setFinder(PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__.'/src/Twilio')
); |
OpenAPI version 7.11.0 states they've added explicit null declarations.
|
Still seeing issues on Twilio SDK 8.3.15, when sending an SMS:
|
Can confirm.
…On Wed, Mar 5, 2025, 8:43 AM Sapphire Cat ***@***.***> wrote:
Still seeing issues on Twilio SDK 8.3.15, when sending an SMS:
PHP Deprecated: Twilio\\Rest\\Api\\V2010\\Account\\MessageList::read(): Implicitly marking parameter $limit as nullable is deprecated, the explicit nullable type must be used instead in /…/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageList.php on line 142
PHP Deprecated: Twilio\\Rest\\Api\\V2010\\Account\\MessageList::stream(): Implicitly marking parameter $limit as nullable is deprecated, the explicit nullable type must be used instead in /…/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageList.php on line 166
PHP Deprecated: Twilio\\Rest\\Api\\V2010\\Account\\MessageInstance::__construct(): Implicitly marking parameter $sid as nullable is deprecated, the explicit nullable type must be used instead in /…/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageInstance.php on line 65
—
Reply to this email directly, view it on GitHub
<#835 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYW6S3AYD7EO4VOHZIPD6D2S4LQJAVCNFSM6AAAAABT3QCV76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBRGMZDSMZRGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
[image: sapphirecat]*sapphirecat* left a comment (twilio/twilio-php#835)
<#835 (comment)>
Still seeing issues on Twilio SDK 8.3.15, when sending an SMS:
PHP Deprecated: Twilio\\Rest\\Api\\V2010\\Account\\MessageList::read(): Implicitly marking parameter $limit as nullable is deprecated, the explicit nullable type must be used instead in /…/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageList.php on line 142
PHP Deprecated: Twilio\\Rest\\Api\\V2010\\Account\\MessageList::stream(): Implicitly marking parameter $limit as nullable is deprecated, the explicit nullable type must be used instead in /…/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageList.php on line 166
PHP Deprecated: Twilio\\Rest\\Api\\V2010\\Account\\MessageInstance::__construct(): Implicitly marking parameter $sid as nullable is deprecated, the explicit nullable type must be used instead in /…/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageInstance.php on line 65
—
Reply to this email directly, view it on GitHub
<#835 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYW6S3AYD7EO4VOHZIPD6D2S4LQJAVCNFSM6AAAAABT3QCV76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBRGMZDSMZRGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I have this one:
|
Nearly 4 months after 8.4's release and we still don't have official support. Come on Twilio! |
I have submitted a PR (#844) that would fix this issue if added to their
pipeline.
I do the same in mine to get around this issue, but yes, Twilio should have
addressed this issue a long time ago.
…On Fri, Mar 14, 2025, 5:05 PM Adrian Jones ***@***.***> wrote:
Nearly 4 months after 8.4's release and we still don't have official
support. Come on Twilio!
—
Reply to this email directly, view it on GitHub
<#835 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYW6S4EEZ64EH2RMTWOSXT2UNOCRAVCNFSM6AAAAABT3QCV76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRVHE3TGOJZG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
[image: adrianbj]*adrianbj* left a comment (twilio/twilio-php#835)
<#835 (comment)>
Nearly 4 months after 8.4's release and we still don't have official
support. Come on Twilio!
—
Reply to this email directly, view it on GitHub
<#835 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABYW6S4EEZ64EH2RMTWOSXT2UNOCRAVCNFSM6AAAAABT3QCV76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRVHE3TGOJZG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Well, for those who aren't interested in waiting for Twilio to fix this issue in any of the ways that have been proposed thus far, you can use this patch alongside |
Issue Summary
There are several instances of this deprecation warning. Given that you still want to support PHP 7.2, the solution is to use the question mark solution rather than union types (which aren't supported until PHP 8).
eg:
Steps to Reproduce
Exception/Log
Technical details:
The text was updated successfully, but these errors were encountered: