-
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
AbstractCarrierInterface::collectRates() has incorrect return signature #28514
Comments
Hi @kassner. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Thank you for your contributions. |
up |
✅ Confirmed by @gabrieldagama Issue Available: @gabrieldagama, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions! |
up |
Summary
\Magento\Shipping\Model\Carrier\AbstractCarrierInterface::collectRates currently has in its signature that it will return
\Magento\Framework\DataObject
, but technically\Magento\Shipping\Model\Rate\Result
is used everywhere, and it does not inherit the DataObject, so the signature is, de facto, incorrect.Examples
\Magento\Shipping\Model\Shipping:
Both append methods expect the result class:
Some Magento shipping modules also don't expect the DataObject to be used:
Flatrate:
Freeshipping:
UPS:
Fedex:
Basically no class expects
\Magento\Framework\DataObject
, as the AbstractCarrierInterface::collectRates() suggests.Proposed solution
Change the method's signature to reflect the real world, but the method is marked with
@api
, so I don't know how to proceed.The text was updated successfully, but these errors were encountered: