- Issue created by @arkener
- First commit to issue fork.
- Merge request !11Issue #3356052: KeyProviderInterface::getKeyValue() doesn't always return a string → (Open) created by Ranjit1032002
- Open on Drupal.org →Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7last update
about 2 years ago Not currently mergeable. - last update
about 2 years ago 8 pass - Status changed to Needs review
about 2 years ago 6:08am 1 May 2023 - 🇮🇳India Ranjit1032002
Created MR!11 for the issue mentioned, please review.
Thank You. - 🇦🇺Australia yovince Melbourne
Thanks, @Ranjit1032002 for the patch. The code looks good to me, and it fixed our issue.
- First commit to issue fork.
- 🇺🇸United States cmlara
The current MR proposes adding return types to the method that conflict with the interface.
The alternative here is that the interface is 100% accurate and the methods returning NULL/FALSE are wrong.
I will note there is no API documented method to indicate an error, it appears the interface was written with the assumption of success always occurring.
- 🇮🇳India rajeshreeputra Pune
Added return type to all interfaces to discuss and finalise accordingly. Then will add return type to all methods in classes.
- 🇺🇸United States cmlara
@rajeshreeputra
That seems significantly out of scope for this issue.
The latest MR makes the API problem worse.
Adding type hints and return types this would generally need to be a new major only change as it breaks compatibility for those of us who have built modules implementing these interface.
Suggest addressing on the feedback from #9, that rather than assuming the API is wrong perhaps the code itself is wrong.
Consider the fact that most of ecosystem is likely not checking for a NULL return (due to API spec) and allowing it does r make sense. An exception would be better since it should be an abnormal condition.