Skip to content

Commit b092ee5

Browse files
committed
32815: Fix PHPCS error related to is deprecated
1 parent 1e9b889 commit b092ee5

File tree

2 files changed

+80
-39
lines changed

2 files changed

+80
-39
lines changed

app/code/Magento/Customer/view/frontend/templates/address/book.phtml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,63 @@
55
*/
66

77
/** @var \Magento\Customer\Block\Address\Book $block */
8+
/** @var \Magento\Framework\Escaper $escaper */
89
?>
910
<div class="block block-addresses-default">
10-
<div class="block-title"><strong><?= $block->escapeHtml(__('Default Addresses')) ?></strong></div>
11+
<div class="block-title"><strong><?= $escaper->escapeHtml(__('Default Addresses')) ?></strong></div>
1112
<div class="block-content">
1213
<?php if ($defaultBillingAddress = $block->getDefaultBilling()): ?>
1314
<div class="box box-address-billing">
1415
<strong class="box-title">
15-
<span><?= $block->escapeHtml(__('Default Billing Address')) ?></span>
16+
<span><?= $escaper->escapeHtml(__('Default Billing Address')) ?></span>
1617
</strong>
1718
<div class="box-content">
1819
<address>
1920
<?= $block->getAddressHtml($block->getAddressById($defaultBillingAddress)) ?>
2021
</address>
2122
</div>
2223
<div class="box-actions">
23-
<a class="action edit" href="<?= $block->escapeUrl($block->getAddressEditUrl($defaultBillingAddress)) ?>">
24-
<span><?= $block->escapeHtml(__('Change Billing Address')) ?></span>
24+
<a class="action edit"
25+
href="<?= $escaper->escapeUrl($block->getAddressEditUrl($defaultBillingAddress)) ?>">
26+
<span><?= $escaper->escapeHtml(__('Change Billing Address')) ?></span>
2527
</a>
2628
</div>
2729
</div>
2830
<?php else: ?>
2931
<div class="box box-billing-address">
30-
<strong class="box-title"><span><?= $block->escapeHtml(__('Default Billing Address')) ?></span></strong>
32+
<strong class="box-title">
33+
<span><?= $escaper->escapeHtml(__('Default Billing Address')) ?></span>
34+
</strong>
3135
<div class="box-content">
32-
<p><?= $block->escapeHtml(__('You have no default billing address in your address book.')) ?></p>
36+
<p><?= $escaper->escapeHtml(__('You have no default billing address in your address book.')) ?></p>
3337
</div>
3438
</div>
3539
<?php endif ?>
3640

3741
<?php if ($defaultShippingAddress = $block->getDefaultShipping()): ?>
3842
<div class="box box-address-shipping">
3943
<strong class="box-title">
40-
<span><?= $block->escapeHtml(__('Default Shipping Address')) ?></span>
44+
<span><?= $escaper->escapeHtml(__('Default Shipping Address')) ?></span>
4145
</strong>
4246
<div class="box-content">
4347
<address>
4448
<?= $block->getAddressHtml($block->getAddressById($defaultShippingAddress)) ?>
4549
</address>
4650
</div>
4751
<div class="box-actions">
48-
<a class="action edit" href="<?= $block->escapeUrl($block->getAddressEditUrl($defaultShippingAddress)) ?>">
49-
<span><?= $block->escapeHtml(__('Change Shipping Address')) ?></span>
52+
<a class="action edit"
53+
href="<?= $escaper->escapeUrl($block->getAddressEditUrl($defaultShippingAddress)) ?>">
54+
<span><?= $escaper->escapeHtml(__('Change Shipping Address')) ?></span>
5055
</a>
5156
</div>
5257
</div>
5358
<?php else: ?>
5459
<div class="box box-shipping-address">
55-
<strong class="box-title"><span><?= $block->escapeHtml(__('Default Shipping Address')) ?></span></strong>
60+
<strong class="box-title">
61+
<span><?= $escaper->escapeHtml(__('Default Shipping Address')) ?></span>
62+
</strong>
5663
<div class="box-content">
57-
<p><?= $block->escapeHtml(__('You have no default shipping address in your address book.')) ?></p>
64+
<p><?= $escaper->escapeHtml(__('You have no default shipping address in your address book.')) ?></p>
5865
</div>
5966
</div>
6067
<?php endif ?>

app/code/Magento/Customer/view/frontend/templates/address/grid.phtml

Lines changed: 62 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,74 +5,108 @@
55
*/
66

77
/** @var \Magento\Customer\Block\Address\Grid $block */
8+
/** @var \Magento\Framework\Escaper $escaper */
89
$customerAddressView = $block->getData('customer_address');
910
?>
1011

1112
<div class="block block-addresses-list">
12-
<div class="block-title"><strong><?= $block->escapeHtml(__('Additional Address Entries')) ?></strong></div>
13+
<div class="block-title"><strong><?= $escaper->escapeHtml(__('Additional Address Entries')) ?></strong></div>
1314
<div class="block-content">
1415
<?php if ($additionalAddresses = $block->getAdditionalAddresses()): ?>
1516
<div class="table-wrapper additional-addresses">
1617
<table class="data table table-additional-addresses-items history" id="additional-addresses-table">
17-
<caption class="table-caption"><?= $block->escapeHtml(__('Additional addresses')) ?></caption>
18+
<caption class="table-caption"><?= $escaper->escapeHtml(__('Additional addresses')) ?></caption>
1819
<thead>
1920
<tr>
20-
<th scope="col" class="col firstname"><?= $block->escapeHtml(__('First Name')) ?></th>
21-
<th scope="col" class="col lastname"><?= $block->escapeHtml(__('Last Name')) ?></th>
22-
<th scope="col" class="col streetaddress"><?= $block->escapeHtml(__('Street Address')) ?></th>
23-
<th scope="col" class="col city"><?= $block->escapeHtml(__('City')) ?></th>
24-
<th scope="col" class="col country"><?= $block->escapeHtml(__('Country')) ?></th>
25-
<th scope="col" class="col state"><?= $block->escapeHtml(__('State')) ?></th>
26-
<th scope="col" class="col zip"><?= $block->escapeHtml(__('Zip/Postal Code')) ?></th>
27-
<th scope="col" class="col phone"><?= $block->escapeHtml(__('Phone')) ?></th>
21+
<th scope="col" class="col firstname"><?= $escaper->escapeHtml(__('First Name')) ?></th>
22+
<th scope="col" class="col lastname"><?= $escaper->escapeHtml(__('Last Name')) ?></th>
23+
<th scope="col" class="col streetaddress"><?= $escaper->escapeHtml(__('Street Address')) ?></th>
24+
<th scope="col" class="col city"><?= $escaper->escapeHtml(__('City')) ?></th>
25+
<th scope="col" class="col country"><?= $escaper->escapeHtml(__('Country')) ?></th>
26+
<th scope="col" class="col state"><?= $escaper->escapeHtml(__('State')) ?></th>
27+
<th scope="col" class="col zip"><?= $escaper->escapeHtml(__('Zip/Postal Code')) ?></th>
28+
<th scope="col" class="col phone"><?= $escaper->escapeHtml(__('Phone')) ?></th>
2829
<th scope="col" class="col actions"> </th>
2930
</tr>
3031
</thead>
3132
<tbody>
3233
<?php foreach ($additionalAddresses as $address): ?>
3334
<tr>
34-
<td data-th="<?= $block->escapeHtml(__('First Name')) ?>" class="col firstname"><?= $block->escapeHtml($address->getFirstname()) ?></td>
35-
<td data-th="<?= $block->escapeHtml(__('Last Name')) ?>" class="col lastname"><?= $block->escapeHtml($address->getLastname()) ?></td>
36-
<td data-th="<?= $block->escapeHtml(__('Street Address')) ?>" class="col streetaddress"><?= $block->escapeHtml($block->getStreetAddress($address)) ?></td>
37-
<td data-th="<?= $block->escapeHtml(__('City')) ?>" class="col city"><?= $block->escapeHtml($address->getCity()) ?></td>
38-
<td data-th="<?= $block->escapeHtml(__('Country')) ?>" class="col country"><?= $block->escapeHtml($block->getCountryByCode($address->getCountryId())) ?></td>
39-
<td data-th="<?= $block->escapeHtml(__('State')) ?>" class="col state"><?= $block->escapeHtml($address->getRegion()->getRegion()) ?></td>
40-
<td data-th="<?= $block->escapeHtml(__('Zip/Postal Code')) ?>" class="col zip"><?= $block->escapeHtml($address->getPostcode()) ?></td>
41-
<td data-th="<?= $block->escapeHtml(__('Phone')) ?>" class="col phone"><?= $block->escapeHtml($address->getTelephone()) ?></td>
42-
<td data-th="<?= $block->escapeHtml(__('Actions')) ?>" class="col actions">
43-
<a class="action edit" href="<?= $block->escapeUrl($block->getUrl('customer/address/edit', ['id' => $address->getId()])) ?>"><span><?= $block->escapeHtml(__('Edit')) ?></span></a>
44-
<a class="action delete" href="#" role="delete-address" data-address="<?= $block->escapeHtmlAttr($address->getId()) ?>"><span><?= $block->escapeHtml(__('Delete')) ?></span></a>
35+
<td data-th="<?= $escaper->escapeHtml(__('First Name')) ?>" class="col firstname">
36+
<?= $escaper->escapeHtml($address->getFirstname()) ?>
37+
</td>
38+
<td data-th="<?= $escaper->escapeHtml(__('Last Name')) ?>" class="col lastname">
39+
<?= $escaper->escapeHtml($address->getLastname()) ?>
40+
</td>
41+
<td data-th="<?= $escaper->escapeHtml(__('Street Address')) ?>" class="col streetaddress">
42+
<?= $escaper->escapeHtml($block->getStreetAddress($address)) ?>
43+
</td>
44+
<td data-th="<?= $escaper->escapeHtml(__('City')) ?>" class="col city">
45+
<?= $escaper->escapeHtml($address->getCity()) ?>
46+
</td>
47+
<td data-th="<?= $escaper->escapeHtml(__('Country')) ?>" class="col country">
48+
<?= $escaper->escapeHtml($block->getCountryByCode($address->getCountryId())) ?>
49+
</td>
50+
<td data-th="<?= $escaper->escapeHtml(__('State')) ?>" class="col state">
51+
<?= $escaper->escapeHtml($address->getRegion()->getRegion()) ?>
52+
</td>
53+
<td data-th="<?= $escaper->escapeHtml(__('Zip/Postal Code')) ?>" class="col zip">
54+
<?= $escaper->escapeHtml($address->getPostcode()) ?>
55+
</td>
56+
<td data-th="<?= $escaper->escapeHtml(__('Phone')) ?>" class="col phone">
57+
<?= $escaper->escapeHtml($address->getTelephone()) ?>
58+
</td>
59+
<td data-th="<?= $escaper->escapeHtml(__('Actions')) ?>" class="col actions">
60+
<a class="action edit" href="
61+
<?= $escaper->escapeUrl(
62+
$block->getUrl('customer/address/edit', ['id' => $address->getId()])
63+
) ?>">
64+
<span><?= $escaper->escapeHtml(__('Edit')) ?></span>
65+
</a>
66+
<a class="action delete"
67+
href="#" role="delete-address"
68+
data-address="<?= $escaper->escapeHtmlAttr($address->getId()) ?>">
69+
<span><?= $escaper->escapeHtml(__('Delete')) ?></span>
70+
</a>
4571
</td>
4672
</tr>
4773
<?php endforeach; ?>
4874
</tbody>
4975
</table>
5076
</div>
51-
<?php if ($block->getChildHtml('pager')) : ?>
77+
<?php if ($block->getChildHtml('pager')): ?>
5278
<div class="customer-addresses-toolbar toolbar bottom"><?= $block->getChildHtml('pager') ?></div>
5379
<?php endif ?>
54-
<?php else : ?>
55-
<p class="empty"><?= $block->escapeHtml(__('You have no other address entries in your address book.')) ?></p>
80+
<?php else: ?>
81+
<p class="empty">
82+
<?= $escaper->escapeHtml(__('You have no other address entries in your address book.')) ?>
83+
</p>
5684
<?php endif ?>
5785
</div>
5886
</div>
5987

6088
<div class="actions-toolbar">
6189
<div class="primary">
62-
<button type="button" role="add-address" title="<?= $block->escapeHtmlAttr(__('Add New Address')) ?>" class="action primary add"><span><?= $block->escapeHtml(__('Add New Address')) ?></span></button>
90+
<button type="button" role="add-address" title="<?= $escaper->escapeHtmlAttr(__('Add New Address')) ?>"
91+
class="action primary add">
92+
<span><?= $escaper->escapeHtml(__('Add New Address')) ?></span>
93+
</button>
6394
</div>
6495
<div class="secondary">
65-
<a class="action back" href="<?= $block->escapeUrl($block->getUrl('customer/account')) ?>"><span><?= $block->escapeHtml(__('Back')) ?></span></a>
96+
<a class="action back"
97+
href="<?= $escaper->escapeUrl($block->getUrl('customer/account')) ?>">
98+
<span><?= $escaper->escapeHtml(__('Back')) ?></span>
99+
</a>
66100
</div>
67101
</div>
68102
<script type="text/x-magento-init">
69103
{
70104
".page-main": {
71105
"address": {
72106
"deleteAddress": "td a[role='delete-address']",
73-
"deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
107+
"deleteUrlPrefix": "<?= $escaper->escapeJs($escaper->escapeUrl($block->getDeleteUrl())) ?>id/",
74108
"addAddress": "button[role='add-address']",
75-
"addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"
109+
"addAddressLocation": "<?= $escaper->escapeJs($escaper->escapeUrl($block->getAddAddressUrl())) ?>"
76110
}
77111
}
78112
}

0 commit comments

Comments
 (0)