You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deprecation Notices raised in PHP 8.1 due to ArrayAccess changes #26
PHP 8.1 introduced typehints (or maybe PHP 8.0?) on some ArrayAccess interface methods, such as offsetExists. This means that (unfortunately) if your code base implements ArrayAccess, but omits the return typehints, you'll get Deprecation notices such as this:
Deprecated: Return type of ClickSend\Model\Email::offsetExists($offset) should either be compatible with
ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used
to temporarily suppress the notice in /app/vendor/clicksend/clicksend-php/lib/Model/Email.php on line 461
I'm not sure how your swagger build process works but my recommendation to keep things simple is just just add the #[\ReturnTypeWillChange] attribute to the generated code where applicable, as explained here: https://php.watch/versions/8.1/ReturnTypeWillChange
What's nice about that solution is that older PHP versions will interpret # as a code comment, so it will work still.
Reacted by Craig Smith, Fabien Salathe, Michael Riecken and David Cumberland
Thank you for your contributions and patience. I want to assure you all they the dev team is aware of the problem and we are looking at implementing the changes you have suggested.
We have a PR that does a temporary fix, and we are looking at modifying the code generation system, and were hoping for a solution that would work from OpenAPI.
In the short term, we will be applying the PR and working out how to generate code that includes the appropriate fixes, most likely with a post-code-generation patch.
Thanks for your kind support and patience. Y'all rock.
Activity
michaelbutler commentedon Mar 6, 2022
I'm not sure how your swagger build process works but my recommendation to keep things simple is just just add the
#[\ReturnTypeWillChange]attribute to the generated code where applicable, as explained here: https://php.watch/versions/8.1/ReturnTypeWillChangeWhat's nice about that solution is that older PHP versions will interpret
#as a code comment, so it will work still.michaelbutler commentedon Jul 3, 2022
As mentioned in PR #27, looks like swagger needs to fix this first, since this repo is just autogenerated code mostly.
kylekatarnls commentedon Jul 5, 2022
👋 Where is the code generator script? It's very likely that extra steps can be added after the script to fix compatibility.
mriecken commentedon Jul 21, 2022
Thank you for your contributions and patience. I want to assure you all they the dev team is aware of the problem and we are looking at implementing the changes you have suggested.
We have a PR that does a temporary fix, and we are looking at modifying the code generation system, and were hoping for a solution that would work from OpenAPI.
In the short term, we will be applying the PR and working out how to generate code that includes the appropriate fixes, most likely with a post-code-generation patch.
Thanks for your kind support and patience. Y'all rock.
Michael
WelshDev commentedon Oct 17, 2022
This is causing some trouble for me also. A proper fix would be very helpful. Thanks
WelshDev commentedon Mar 1, 2023
@mriecken is there any update on getting this patched?
BafS commentedon Jul 17, 2023
Ping @mriecken, it's been more than a year now, could you please help us fixing this commercial library?
HarryWiles commentedon Nov 8, 2023
We've waited so long and still no fix - sadly I think we'll have to take our $7000/m of sms to another provider 😭
sudo-plz commentedon Nov 8, 2023
I've requested support through their form, hopefully this will be noticed.
BafS commentedon Nov 8, 2023
I tried that multiple times and they never went back to me.
The good new is that Symfony supports it officially with the Notifier component (https://github.com/symfony/symfony/tree/6.4/src/Symfony/Component/Notifier/Bridge/ClickSend)