-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Reflection: Fix null as first return type #25806
Reflection: Fix null as first return type #25806
Conversation
…first type in return type
Hi @Parakoopa. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
- phpcs:ignore added because this line was not actually touched
I had to remove the exception I added to catch cases, where only null is defined as a return type for methods, which isn't supported by the code resolving type instances of return types. The reason for this is, that the reflection logic also seems to be used during integration tests, and there are methods used there which actually return null. There are no errors being thrown there, so assume in those cases null is actually supported as a return type by the reflection logic. For reference, here are the logs of the integration builds:
This means methods that only have null as a return type will still throw the same weird exceptions mentioned in the issue (when used via webapi), but the integration tests are working again. Methods that can return null AND a valid type are now working correctly, regardless of order. |
Hi @ihor-sviziev, thank you for the review.
|
✔️ QA Passed |
Hi @Parakoopa, thank you for your contribution! |
Description (*)
This fixes null as the first return type for methods used in the service layer.
The examples given in #25656 are now working. Additionally the Swagger schema generation no longer fails with the exception
The "" data type isn't declared. Verify the type and try again.
.If null is the only return type, a new exception will be thrown.It's not, see comments belowFixed Issues
Manual testing scenarios (*)
Contribution checklist (*)