Skip to content

Commit 00844ad

Browse files
Merge remote-tracking branch '40114/fix-accepted-types-for-escaper-methods' into sept-comprs
2 parents 3d89fd8 + 650625e commit 00844ad

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

app/code/Magento/Sales/Block/Adminhtml/Order/Comments/View.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ public function canSendCommentEmail()
109109
/**
110110
* Replace links in string
111111
*
112-
* @param array|string $data
112+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
113113
* @param null|array $allowedTags
114-
* @return string
114+
* @return ($data is array ? string[] : string)
115115
*/
116116
public function escapeHtml($data, $allowedTags = null)
117117
{

app/code/Magento/Sales/Block/Adminhtml/Order/View/History.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2013 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento\Sales\Block\Adminhtml\Order\View;
77

@@ -132,9 +132,9 @@ public function isCustomerNotificationNotApplicable(\Magento\Sales\Model\Order\S
132132
/**
133133
* Replace links in string
134134
*
135-
* @param array|string $data
135+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
136136
* @param null|array $allowedTags
137-
* @return string
137+
* @return ($data is array ? string[] : string)
138138
*/
139139
public function escapeHtml($data, $allowedTags = null)
140140
{

app/code/Magento/Sales/Helper/Admin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2013 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -154,9 +154,9 @@ public function applySalableProductTypesFilter($collection)
154154
/**
155155
* Escape string preserving links
156156
*
157-
* @param string $data
157+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
158158
* @param null|array $allowedTags
159-
* @return string
159+
* @return ($data is array ? string[] : string)
160160
*/
161161
public function escapeHtmlWithLinks($data, $allowedTags = null)
162162
{

lib/internal/Magento/Framework/Escaper.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -70,9 +70,9 @@ class Escaper
7070
* AllowedTags will not be escaped, except the following: script, img, embed,
7171
* iframe, video, source, object, audio
7272
*
73-
* @param string|array $data
73+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
7474
* @param array|null $allowedTags
75-
* @return string|array
75+
* @return ($data is array ? string[] : string)
7676
*/
7777
public function escapeHtml($data, $allowedTags = null)
7878
{
@@ -267,7 +267,7 @@ private function escapeAttributeValue($name, $value)
267267
/**
268268
* Escape a string for the HTML attribute context
269269
*
270-
* @param string $string
270+
* @param string|int|float|\Stringable $string
271271
* @param boolean $escapeSingleQuote
272272
* @return string
273273
* @since 101.0.0
@@ -313,7 +313,7 @@ public function encodeUrlParam($string)
313313
/**
314314
* Escape string for the JavaScript context
315315
*
316-
* @param string $string
316+
* @param string|int|float|\Stringable $string
317317
* @return string
318318
* @since 101.0.0
319319
*/

lib/internal/Magento/Framework/View/Element/AbstractBlock.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -892,9 +892,9 @@ public static function extractModuleName($className)
892892
/**
893893
* Escape HTML entities
894894
*
895-
* @param string|array $data
895+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
896896
* @param array|null $allowedTags
897-
* @return string
897+
* @return ($data is array ? string[] : string)
898898
* @deprecated 103.0.0 Use $escaper directly in templates and in blocks.
899899
* @see Escaper Usage
900900
*/
@@ -906,7 +906,7 @@ public function escapeHtml($data, $allowedTags = null)
906906
/**
907907
* Escape string for the JavaScript context
908908
*
909-
* @param string $string
909+
* @param string|int|float|\Stringable $string
910910
* @return string
911911
* @since 101.0.0
912912
* @deprecated 103.0.0 Use $escaper directly in templates and in blocks.
@@ -920,7 +920,7 @@ public function escapeJs($string)
920920
/**
921921
* Escape a string for the HTML attribute context
922922
*
923-
* @param string $string
923+
* @param string|int|float|\Stringable $string
924924
* @param boolean $escapeSingleQuote
925925
* @return string
926926
* @since 101.0.0

0 commit comments

Comments
 (0)