Skip to content

Commit ec51bd2

Browse files
committed
Fix error in PHP code sniffer
1 parent c84087e commit ec51bd2

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ public function testRenderMsrpEnabled()
246246

247247
//assert price wrapper
248248
$this->assertEquals(
249-
'<div class="price-box price-final_price" data-role="priceBox" data-product-id="" data-price-box="product-id-">test</div>',
249+
'<div class="price-box price-final_price" data-role="priceBox" data-product-id="" ' .
250+
'data-price-box="product-id-">test</div>',
250251
$result
251252
);
252253
}

app/code/Magento/Swatches/view/frontend/templates/product/listing/renderer.phtml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
* See COPYING.txt for license details.
55
*/
66
?>
7-
<?php /** @var $block \Magento\Swatches\Block\Product\Renderer\Listing\Configurable */ ?>
8-
<div class="swatch-opt-<?= /* @escapeNotVerified */ $block->getProduct()->getId() ?>" data-role="swatch-option-<?= /* @escapeNotVerified */ $block->getProduct()->getId() ?>"></div>
7+
<?php
8+
/** @var $block \Magento\Swatches\Block\Product\Renderer\Listing\Configurable */
9+
$productId = $block->getProduct()->getId();
10+
?>
11+
<div class="swatch-opt-<?= /* @escapeNotVerified */ $productId ?>" data-role="swatch-option-<?= /* @escapeNotVerified */ $productId ?>"></div>
912

1013
<script type="text/x-magento-init">
1114
{
12-
"[data-role=swatch-option-<?= /* @escapeNotVerified */ $block->getProduct()->getId() ?>]": {
15+
"[data-role=swatch-option-<?= /* @escapeNotVerified */ $productId ?>]": {
1316
"Magento_Swatches/js/swatch-renderer": {
1417
"selectorProduct": ".product-item-details",
1518
"onlySwatches": true,
@@ -25,7 +28,7 @@
2528

2629
<script type="text/x-magento-init">
2730
{
28-
"[data-role=priceBox][data-price-box=product-id-<?= /* @escapeNotVerified */ $block->escapeHtml($block->getProduct()->getId()) ?>]": {
31+
"[data-role=priceBox][data-price-box=product-id-<?= /* @escapeNotVerified */ $productId ?>]": {
2932
"priceBox": {
3033
"priceConfig": {
3134
"priceFormat": <?= /* @escapeNotVerified */ $block->getPriceFormatJson(); ?>,

0 commit comments

Comments
 (0)