Skip to content

[Issue] Update bundle price renderer docblock #31845

Open
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #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#<issue_number>

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 (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

Labels

Area: FrameworkComponent: BundleIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: PR in progressReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions