Skip to content

Commit 0ccb7b7

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-56441: Eliminate @escapeNotVerified in Product and Catalog Rules Modules
1 parent 612abd6 commit 0ccb7b7

File tree

5 files changed

+29
-18
lines changed

5 files changed

+29
-18
lines changed

app/code/Magento/CatalogRule/view/adminhtml/templates/promo/fieldset.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<fieldset id="<?= $block->escapeHtmlAttr($_jsObjectName) ?>" <?= /* @noEscape */ $_element->serialize(['class']) ?> class="fieldset">
1313
<legend class="legend"><span><?= $block->escapeHtml($_element->getLegend()) ?></span></legend>
1414
<br>
15-
<?php if ($_element->getComment()): ?>
15+
<?php if ($_element->getComment()) : ?>
1616
<div class="messages">
1717
<div class="message message-notice"><?= $block->escapeHtml($_element->getComment()) ?></div>
1818
</div>
@@ -29,7 +29,7 @@ require([
2929
], function(VarienRulesForm){
3030

3131
window.<?= $block->escapeJs($_jsObjectName) ?> = new VarienRulesForm('<?= /* @noEscape */ $_jsObjectName ?>', '<?= /* @noEscape */ $block->getNewChildUrl() ?>');
32-
<?php if ($_element->getReadonly()): ?>
32+
<?php if ($_element->getReadonly()) : ?>
3333
<?= /* @noEscape */ $_element->getHtmlId() ?>.setReadonly(true);
3434
<?php endif; ?>
3535

app/code/Magento/Msrp/view/base/templates/product/price/msrp.phtml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,29 @@ $msrpPrice = $block->renderAmount(
3232
$priceElementIdPrefix = $block->getPriceElementIdPrefix() ? $block->getPriceElementIdPrefix() : 'product-price-';
3333
?>
3434

35-
<?php if ($amount): ?>
35+
<?php if ($amount) : ?>
3636
<span class="old-price map-old-price"><?= /* @noEscape */ $msrpPrice ?></span>
3737
<span class="map-fallback-price normal-price"><?= /* @noEscape */ $msrpPrice ?></span>
3838
<?php endif; ?>
3939

40-
<?php if ($priceType->isShowPriceOnGesture()): ?>
40+
<?php if ($priceType->isShowPriceOnGesture()) : ?>
4141
<?php
4242

4343
$addToCartUrl = '';
4444
if ($product->isSaleable()) {
4545
/** @var Magento\Catalog\Block\Product\AbstractProduct $addToCartUrlGenerator */
46-
$addToCartUrlGenerator = $block->getLayout()->getBlockSingleton('Magento\Catalog\Block\Product\AbstractProduct');
46+
$addToCartUrlGenerator = $block->getLayout()->getBlockSingleton(\Magento\Catalog\Block\Product\AbstractProduct::class);
47+
// phpcs:disable
4748
$addToCartUrl = $addToCartUrlGenerator->getAddToCartUrl(
4849
$product,
4950
['_query' => [
5051
\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED =>
51-
$this->helper('Magento\Framework\Url\Helper\Data')->getEncodedUrl(
52+
$this->helper(\Magento\Framework\Url\Helper\Data::class)->getEncodedUrl(
5253
$addToCartUrlGenerator->getAddToCartUrl($product)
5354
),
5455
]]
5556
);
57+
// phpcs:enable
5658
}
5759

5860
$priceElementId = $priceElementIdPrefix . $productId . $block->getIdSuffix();
@@ -77,24 +79,29 @@ $priceElementIdPrefix = $block->getPriceElementIdPrefix() ? $block->getPriceElem
7779
$data['addToCart']['addToCartButton'] = sprintf(
7880
'form:has(input[type="hidden"][name="product"][value="%s"]) button[type="submit"]',
7981
(int) $productId . ',' .
80-
sprintf('.block.widget .price-box[data-product-id=%s]+.product-item-actions button.tocart',
81-
(int) $productId));
82+
sprintf(
83+
'.block.widget .price-box[data-product-id=%s]+.product-item-actions button.tocart',
84+
(int)$productId
85+
)
86+
);
8287
}
8388
?>
8489
<span id="<?= $block->escapeHtmlAttr($block->getPriceId() ? $block->getPriceId() : $priceElementId) ?>" style="display:none"></span>
8590
<a href="javascript:void(0);"
8691
id="<?= /* @noEscape */ ($popupId) ?>"
8792
class="action map-show-info"
88-
data-mage-init='<?= /* @noEscape */ $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($data) ?>'>
93+
<?php //phpcs:disable ?>
94+
data-mage-init='<?= /* @noEscape */ $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($data) ?>'>
95+
<?php //phpcs:enable ?>
8996
<?= $block->escapeHtml(__('Click for price')) ?>
9097
</a>
91-
<?php else: ?>
98+
<?php else : ?>
9299
<span class="msrp-message">
93100
<?= $block->escapeHtml($priceType->getMsrpPriceMessage()) ?>
94101
</span>
95102
<?php endif; ?>
96103

97-
<?php if ($block->getZone() == \Magento\Framework\Pricing\Render::ZONE_ITEM_VIEW): ?>
104+
<?php if ($block->getZone() == \Magento\Framework\Pricing\Render::ZONE_ITEM_VIEW) : ?>
98105
<?php $helpLinkId = 'msrp-help-' . $productId . $block->getRandomString(20); ?>
99106
<a href="javascript:void(0);"
100107
id="<?= /* @noEscape */ $helpLinkId ?>"

app/code/Magento/Msrp/view/frontend/templates/popup.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<?php
88
/** @var \Magento\Msrp\Block\Popup $block */
99
?>
10-
<?php if ($block->isEnabled()): ?>
10+
<?php if ($block->isEnabled()) : ?>
1111
<script data-role="msrp-popup-template" type="text/x-magento-template">
1212
<div id="map-popup-click-for-price" class="map-popup">
1313
<div class="popup-header">

app/code/Magento/Msrp/view/frontend/templates/render/item/price_msrp_item.phtml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,24 @@
1313
*/
1414
?>
1515
<?php
16+
//phpcs:disable
1617
/** @var $pricingHelper \Magento\Framework\Pricing\Helper\Data */
17-
$pricingHelper = $this->helper('Magento\Framework\Pricing\Helper\Data');
18+
$pricingHelper = $this->helper(\Magento\Framework\Pricing\Helper\Data::class);
1819
/** @var $_catalogHelper \Magento\Catalog\Helper\Data */
19-
$_catalogHelper = $this->helper('Magento\Catalog\Helper\Data');
20+
$_catalogHelper = $this->helper(\Magento\Catalog\Helper\Data::class);
21+
//phpcs:enable
2022

2123
/** @var $_product \Magento\Catalog\Model\Product */
2224
$_product = $block->getProduct();
2325
$_id = $_product->getId();
2426
$_msrpPrice = '';
2527
?>
2628
<div class="price-box msrp">
27-
<?php if ($_product->getMsrp()): ?>
29+
<?php if ($_product->getMsrp()) : ?>
2830
<?php $_msrpPrice = $pricingHelper->currency($_product->getMsrp(), true, false) ?>
2931
<span class="old-price"><?= /* @noEscape */ $_msrpPrice ?></span>
3032
<?php endif; ?>
31-
<?php if ($_catalogHelper->isShowPriceOnGesture($_product)): ?>
33+
<?php if ($_catalogHelper->isShowPriceOnGesture($_product)) : ?>
3234
<?php $priceElementId = 'product-price-' . $_id . $block->getIdSuffix(); ?>
3335
<span id="<?= /* @noEscape */ $priceElementId ?>" style="display: none"></span>
3436
<?php $popupId = 'msrp-popup-' . $_id . $block->getRandomString(20); ?>
@@ -42,7 +44,7 @@
4244
"popupCartButtonId": "#map-popup-button",
4345
"cartForm": "#wishlist-view-form"}}'><?= $block->escapeHtml(__('Click for price')) ?>
4446
</a>
45-
<?php else: ?>
47+
<?php else : ?>
4648
<span class="msrp-message">
4749
<?= $block->escapeHtml($_catalogHelper->getMsrpPriceMessage($_product)) ?>
4850
</span>

app/code/Magento/Msrp/view/frontend/templates/render/item/price_msrp_rss.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
*/
1313
?>
1414
<div class="price-box msrp">
15-
<?php if ($this->helper('Magento\Msrp\Helper\Data')->canApplyMsrp($block->getProduct())): ?>
15+
<?php //phpcs:disable ?>
16+
<?php if ($this->helper(\Magento\Msrp\Helper\Data::class)->canApplyMsrp($block->getProduct())) : ?>
17+
<?php //phpcs:enable ?>
1618
<a href="<?= $block->escapeUrl($block->getProduct()->getProductUrl()) ?>">
1719
<?= $block->escapeHtml(__('Click for price')) ?>
1820
</a>

0 commit comments

Comments
 (0)