[Issue] Fix incorrect return type for getOptionByCode method #39404
Labels
Area: Framework
Component: Quote
Component: Wishlist
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Priority: P2
A defect with this priority could have functionality issues which are not to expectations.
Progress: PR in progress
Reported on 2.4.x
Indicates original Magento version for the Issue report.
Reproduced on 2.4.x
The issue has been reproduced on latest 2.4-develop branch
Triage: Dev.Experience
Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
This issue is automatically created based on existing pull request: #39389: Fix incorrect return type for getOptionByCode method
Description (*)
I've noticed that
\Magento\Catalog\Model\Product\Configuration\Item\ItemInterface::getOptionByCode
return type is defined as object all the time:magento2/app/code/Magento/Catalog/Model/Product/Configuration/Item/ItemInterface.php
Lines 24 to 30 in b2ce2a3
However, this interface implements 3 classes, and each of them returns object OR null, so it's a bug in the method definition on interface:
magento2/app/code/Magento/Quote/Model/Quote/Address/Item.php
Lines 200 to 210 in 6729b6e
magento2/app/code/Magento/Quote/Model/Quote/Item.php
Lines 726 to 738 in 2afe92f
magento2/app/code/Magento/Wishlist/Model/Item.php
Lines 697 to 709 in 795b2c6
This pull request fixes incorrect phpdoc block, which leads to confusion, which leads to bugs during development
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)
The text was updated successfully, but these errors were encountered: