magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.47k stars 9.29k forks source link

[Issue] Update bundle price renderer docblock #31845

Open m2-assistant[bot] opened 3 years ago

m2-assistant[bot] commented 3 years ago

This issue is automatically created based on existing pull request: magento/magento2#31823: Update bundle price renderer docblock


Description

PHPStan fails when using the original block:

 ------ --------------------------------------------------------------------------------------------------------------------- 
  Line   app/design/frontend/my/theme-x/Magento_Bundle/templates/email/order/items/creditmemo/default.phtml  
 ------ --------------------------------------------------------------------------------------------------------------------- 
  25     Parameter #1 $item of method                                                                                         
         Magento\Bundle\Block\Sales\Order\Items\Renderer::getItemPrice()                                                      
         expects                                                                                                              
         Magento\Bundle\Block\Sales\Order\Items\CreditmemoItem|Magento\Bundle\                                                
         Block\Sales\Order\Items\InvoiceItem|Magento\Bundle\Block\Sales\Order\                                                
         Items\OrderItem, Magento\Sales\Model\Order\Item given.                                                               
 ------ --------------------------------------------------------------------------------------------------------------------- 

default.phtml line 25:

<p class="item-price"><?= /* @noEscape */ $block->getItemPrice($item->getOrderItem()) ?></p>

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#

Manual testing scenarios

  1. Configure PHPStan to run against your app/design files;
  2. Have the following line on your app/design/frontend/my/theme-x/Magento_Bundle/templates/email/order/items/creditmemo/default.phtml file:
<p class="item-price"><?= /* @noEscape */ $block->getItemPrice($item->getOrderItem()) ?></p>

Questions or comments

Contribution checklist (*)

m2-assistant[bot] commented 5 months ago

Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-November commented 5 months ago

Hello @kassner,

Thank you for the report and collaboration!

Verified this issue on 2.4-develop. When calling $item->getOrderItem() of type Magento\Sales\Model\Order\Item inside $block->getItemPrice($item->getOrderItem()) of type \Magento\Bundle\Block\Sales\Order\Items\Renderer, php stan is throwing the below error:

image

The return type of getItemPrice method is incorrect.

Hence confirming the issue.

Thank you.

github-jira-sync-bot commented 5 months ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-11737 is successfully created for this GitHub issue.

m2-assistant[bot] commented 5 months ago

:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

github-jira-sync-bot commented 5 months ago

:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-11737