Skip to content

Commit d51d9d7

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into mtf-eol
2 parents 71ce417 + 8b3fd9d commit d51d9d7

File tree

444 files changed

+8280
-3465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

444 files changed

+8280
-3465
lines changed

app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_block.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.notification.container.grid" as="grid">
1212
<arguments>
1313
<argument name="id" xsi:type="string">notificationGrid</argument>
14-
<argument name="dataSource" xsi:type="object">Magento\AdminNotification\Model\ResourceModel\Grid\Collection</argument>
14+
<argument name="dataSource" xsi:type="object" shared="false">Magento\AdminNotification\Model\ResourceModel\Grid\Collection</argument>
1515
<argument name="default_dir" xsi:type="string">DESC</argument>
1616
<argument name="default_sort" xsi:type="string">date_added</argument>
1717
<argument name="save_parameters_in_session" xsi:type="string">1</argument>

app/code/Magento/AdvancedSearch/view/adminhtml/layout/catalog_search_block.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<block class="Magento\AdvancedSearch\Block\Adminhtml\Search\Grid" name="search.edit.grid" as="grid">
1212
<arguments>
1313
<argument name="id" xsi:type="string">catalog_search_grid</argument>
14-
<argument name="dataSource" xsi:type="object">Magento\AdvancedSearch\Model\ResourceModel\Search\Grid\Collection</argument>
14+
<argument name="dataSource" xsi:type="object" shared="false">Magento\AdvancedSearch\Model\ResourceModel\Search\Grid\Collection</argument>
1515
<argument name="default_sort" xsi:type="string">name</argument>
1616
<argument name="default_dir" xsi:type="string">ASC</argument>
1717
<argument name="save_parameters_in_session" xsi:type="string">1</argument>

app/code/Magento/Authorization/Model/Role.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,29 @@ public function __construct(
5151
}
5252

5353
/**
54-
* {@inheritdoc}
54+
* @inheritDoc
55+
*
56+
* @SuppressWarnings(PHPMD.SerializationAware)
57+
* @deprecated Do not use PHP serialization.
5558
*/
5659
public function __sleep()
5760
{
61+
trigger_error('Using PHP serialization is deprecated', E_USER_DEPRECATED);
62+
5863
$properties = parent::__sleep();
5964
return array_diff($properties, ['_resource', '_resourceCollection']);
6065
}
6166

6267
/**
63-
* {@inheritdoc}
68+
* @inheritDoc
69+
*
70+
* @SuppressWarnings(PHPMD.SerializationAware)
71+
* @deprecated Do not use PHP serialization.
6472
*/
6573
public function __wakeup()
6674
{
75+
trigger_error('Using PHP serialization is deprecated', E_USER_DEPRECATED);
76+
6777
parent::__wakeup();
6878
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
6979
$this->_resource = $objectManager->get(\Magento\Authorization\Model\ResourceModel\Role::class);

app/code/Magento/AuthorizenetAcceptjs/Gateway/Validator/TransactionResponseValidator.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ public function validate(array $validationSubject): ResultInterface
5454
if (isset($transactionResponse['messages']['message']['code'])) {
5555
$errorCodes[] = $transactionResponse['messages']['message']['code'];
5656
$errorMessages[] = $transactionResponse['messages']['message']['text'];
57-
} elseif ($transactionResponse['messages']['message']) {
57+
} elseif (isset($transactionResponse['messages']['message'])) {
5858
foreach ($transactionResponse['messages']['message'] as $message) {
5959
$errorCodes[] = $message['code'];
6060
$errorMessages[] = $message['description'];
6161
}
6262
} elseif (isset($transactionResponse['errors'])) {
6363
foreach ($transactionResponse['errors'] as $message) {
6464
$errorCodes[] = $message['errorCode'];
65-
$errorMessages[] = $message['errorCode'];
65+
$errorMessages[] = $message['errorText'];
6666
}
6767
}
6868

@@ -85,8 +85,10 @@ private function isResponseCodeAnError(array $transactionResponse): bool
8585
?? $transactionResponse['errors'][0]['errorCode']
8686
?? null;
8787

88-
return in_array($transactionResponse['responseCode'], [self::RESPONSE_CODE_APPROVED, self::RESPONSE_CODE_HELD])
89-
&& $code
88+
return !in_array($transactionResponse['responseCode'], [
89+
self::RESPONSE_CODE_APPROVED, self::RESPONSE_CODE_HELD
90+
])
91+
|| $code
9092
&& !in_array(
9193
$code,
9294
[

app/code/Magento/AuthorizenetAcceptjs/Test/Unit/Gateway/Validator/TransactionResponseValidatorTest.php

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@
1515
use PHPUnit\Framework\MockObject\MockObject;
1616
use PHPUnit\Framework\TestCase;
1717

18+
/**
19+
* Tests for the transaction response validator
20+
*/
1821
class TransactionResponseValidatorTest extends TestCase
1922
{
2023
private const RESPONSE_CODE_APPROVED = 1;
2124
private const RESPONSE_CODE_HELD = 4;
25+
private const RESPONSE_CODE_DENIED = 2;
2226
private const RESPONSE_REASON_CODE_APPROVED = 1;
2327
private const RESPONSE_REASON_CODE_PENDING_REVIEW_AUTHORIZED = 252;
2428
private const RESPONSE_REASON_CODE_PENDING_REVIEW = 253;
29+
private const ERROR_CODE_AVS_MISMATCH = 27;
2530

2631
/**
2732
* @var ResultInterfaceFactory|MockObject
@@ -86,16 +91,6 @@ public function testValidateScenarios($transactionResponse, $isValid, $errorCode
8691
public function scenarioProvider()
8792
{
8893
return [
89-
// This validator only cares about successful edge cases so test for default behavior
90-
[
91-
[
92-
'responseCode' => 'foo',
93-
],
94-
true,
95-
[],
96-
[]
97-
],
98-
9994
// Test for acceptable reason codes
10095
[
10196
[
@@ -208,6 +203,29 @@ public function scenarioProvider()
208203
['foo'],
209204
['bar']
210205
],
206+
[
207+
[
208+
'responseCode' => self::RESPONSE_CODE_DENIED,
209+
'errors' => [
210+
[
211+
'errorCode' => self::ERROR_CODE_AVS_MISMATCH,
212+
'errorText' => 'bar'
213+
]
214+
]
215+
],
216+
false,
217+
[self::ERROR_CODE_AVS_MISMATCH],
218+
['bar']
219+
],
220+
// This validator only cares about successful edge cases so test for default behavior
221+
[
222+
[
223+
'responseCode' => 'foo',
224+
],
225+
false,
226+
[],
227+
[]
228+
],
211229
];
212230
}
213231
}

app/code/Magento/Backend/Block/Dashboard/Graph.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ public function __construct(
114114
\Magento\Backend\Helper\Dashboard\Data $dashboardData,
115115
array $data = []
116116
) {
117-
$this->_dashboardData = $dashboardData;
118117
parent::__construct($context, $collectionFactory, $data);
118+
$this->_dashboardData = $dashboardData;
119119
}
120120

121121
/**
@@ -131,7 +131,7 @@ protected function _getTabTemplate()
131131
/**
132132
* Set data rows
133133
*
134-
* @param array $rows
134+
* @param string $rows
135135
* @return void
136136
*/
137137
public function setDataRows($rows)
@@ -155,15 +155,14 @@ public function addSeries($seriesId, array $options)
155155
* Get series
156156
*
157157
* @param string $seriesId
158-
* @return array|false
158+
* @return array|bool
159159
*/
160160
public function getSeries($seriesId)
161161
{
162162
if (isset($this->_allSeries[$seriesId])) {
163163
return $this->_allSeries[$seriesId];
164-
} else {
165-
return false;
166164
}
165+
return false;
167166
}
168167

169168
/**
@@ -308,7 +307,7 @@ public function getChartUrl($directUrl = true)
308307

309308
if ($minvalue >= 0 && $maxvalue >= 0) {
310309
if ($maxvalue > 10) {
311-
$p = pow(10, $this->_getPow($maxvalue));
310+
$p = pow(10, $this->_getPow((int) $maxvalue));
312311
$maxy = ceil($maxvalue / $p) * $p;
313312
$yLabels = range($miny, $maxy, $p);
314313
} else {
@@ -349,7 +348,7 @@ public function getChartUrl($directUrl = true)
349348
$indexid = 0;
350349
foreach ($this->_axisLabels as $idx => $labels) {
351350
if ($idx == 'x') {
352-
$this->formatAxisLabelDate($idx, $timezoneLocal);
351+
$this->formatAxisLabelDate((string) $idx, (string) $timezoneLocal);
353352
$tmpstring = implode('|', $this->_axisLabels[$idx]);
354353
$valueBuffer[] = $indexid . ":|" . $tmpstring;
355354
} elseif ($idx == 'y') {
@@ -369,13 +368,12 @@ public function getChartUrl($directUrl = true)
369368
foreach ($params as $name => $value) {
370369
$p[] = $name . '=' . urlencode($value);
371370
}
372-
return self::API_URL . '?' . implode('&', $p);
373-
} else {
374-
$gaData = urlencode(base64_encode(json_encode($params)));
375-
$gaHash = $this->_dashboardData->getChartDataHash($gaData);
376-
$params = ['ga' => $gaData, 'h' => $gaHash];
377-
return $this->getUrl('adminhtml/*/tunnel', ['_query' => $params]);
371+
return (string) self::API_URL . '?' . implode('&', $p);
378372
}
373+
$gaData = urlencode(base64_encode(json_encode($params)));
374+
$gaHash = $this->_dashboardData->getChartDataHash($gaData);
375+
$params = ['ga' => $gaData, 'h' => $gaHash];
376+
return $this->getUrl('adminhtml/*/tunnel', ['_query' => $params]);
379377
}
380378

381379
/**
@@ -394,7 +392,7 @@ private function formatAxisLabelDate($idx, $timezoneLocal)
394392
switch ($this->getDataHelper()->getParam('period')) {
395393
case '24h':
396394
$this->_axisLabels[$idx][$_index] = $this->_localeDate->formatDateTime(
397-
$period->setTime($period->format('H'), 0, 0),
395+
$period->setTime((int) $period->format('H'), 0, 0),
398396
\IntlDateFormatter::NONE,
399397
\IntlDateFormatter::SHORT
400398
);

0 commit comments

Comments
 (0)