Skip to content

Commit 20a95b7

Browse files
committed
Merge branch '2.4-develop' of github.com:magento-commerce/magento2ce into CABPI-429
2 parents f6d36b6 + d74bbf7 commit 20a95b7

File tree

68 files changed

+1336
-575
lines changed

Some content is hidden

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

68 files changed

+1336
-575
lines changed

app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminAdobeImsEnabledInfoCommandTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<severity value="MINOR"/>
1818
<group value="admin_ims"/>
1919
<skip>
20-
<issueId value="DEPRECATED">Temp disable</issueId>
20+
<issueId value="AC-3153">Skipped</issueId>
2121
</skip>
2222
<testCaseId value="CABPI-186"/>
2323
</annotations>

app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminSignInWithAdobeIdTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<group value="admin_ims"/>
1818
<testCaseId value="CABPI-102"/>
1919
<skip>
20-
<issueId value="DEPRECATED">Temp disable</issueId>
20+
<issueId value="AC-3153">Skipped</issueId>
2121
</skip>
2222
</annotations>
2323
<before>

app/code/Magento/AdminAdobeIms/Test/Mftf/Test/CallbackWithoutCodeRedirectsToAdminLoginTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<severity value="CRITICAL"/>
1717
<group value="admin_ims"/>
1818
<skip>
19-
<issueId value="DEPRECATED">Temp disable</issueId>
19+
<issueId value="AC-3153">Skipped</issueId>
2020
</skip>
2121
<testCaseId value="CABPI-205"/>
2222
</annotations>

app/code/Magento/AdminAdobeIms/Test/Mftf/Test/CreateNewUserWithoutPasswordTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<severity value="CRITICAL"/>
1717
<group value="admin_ims"/>
1818
<skip>
19-
<issueId value="DEPRECATED">Temp disable</issueId>
19+
<issueId value="AC-3153">Skipped</issueId>
2020
</skip>
2121
<testCaseId value="CABPI-227"/>
2222
</annotations>

app/code/Magento/AdminNotification/Model/Feed.php

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,22 @@
55
*/
66
namespace Magento\AdminNotification\Model;
77

8-
use Magento\Framework\Escaper;
8+
use Magento\AdminNotification\Model\InboxFactory;
9+
use Magento\Backend\App\ConfigInterface;
10+
use Magento\Framework\App\DeploymentConfig;
911
use Magento\Framework\App\ObjectManager;
12+
use Magento\Framework\App\ProductMetadataInterface;
1013
use Magento\Framework\Config\ConfigOptionsListConstants;
14+
use Magento\Framework\Data\Collection\AbstractDb;
15+
use Magento\Framework\Escaper;
16+
use Magento\Framework\HTTP\Adapter\Curl;
17+
use Magento\Framework\HTTP\Adapter\CurlFactory;
18+
use Magento\Framework\Model\AbstractModel;
19+
use Magento\Framework\Model\Context;
20+
use Magento\Framework\Model\ResourceModel\AbstractResource;
21+
use Magento\Framework\Registry;
22+
use Magento\Framework\UrlInterface;
23+
use SimpleXMLElement;
1124

1225
/**
1326
* AdminNotification Feed model
@@ -16,87 +29,85 @@
1629
* @api
1730
* @since 100.0.2
1831
*/
19-
class Feed extends \Magento\Framework\Model\AbstractModel
32+
class Feed extends AbstractModel
2033
{
21-
const XML_USE_HTTPS_PATH = 'system/adminnotification/use_https';
34+
public const XML_USE_HTTPS_PATH = 'system/adminnotification/use_https';
2235

23-
const XML_FEED_URL_PATH = 'system/adminnotification/feed_url';
36+
public const XML_FEED_URL_PATH = 'system/adminnotification/feed_url';
2437

25-
const XML_FREQUENCY_PATH = 'system/adminnotification/frequency';
38+
public const XML_FREQUENCY_PATH = 'system/adminnotification/frequency';
2639

27-
const XML_LAST_UPDATE_PATH = 'system/adminnotification/last_update';
40+
public const XML_LAST_UPDATE_PATH = 'system/adminnotification/last_update';
2841

2942
/**
3043
* @var Escaper
3144
*/
3245
private $escaper;
3346

3447
/**
35-
* Feed url
36-
*
3748
* @var string
3849
*/
3950
protected $_feedUrl;
4051

4152
/**
42-
* @var \Magento\Backend\App\ConfigInterface
53+
* @var ConfigInterface
4354
*/
4455
protected $_backendConfig;
4556

4657
/**
47-
* @var \Magento\AdminNotification\Model\InboxFactory
58+
* @var InboxFactory
4859
*/
4960
protected $_inboxFactory;
5061

5162
/**
52-
* @var \Magento\Framework\HTTP\Adapter\CurlFactory
63+
* @var CurlFactory
5364
*
5465
*/
5566
protected $curlFactory;
5667

5768
/**
5869
* Deployment configuration
5970
*
60-
* @var \Magento\Framework\App\DeploymentConfig
71+
* @var DeploymentConfig
6172
*/
6273
protected $_deploymentConfig;
6374

6475
/**
65-
* @var \Magento\Framework\App\ProductMetadataInterface
76+
* @var ProductMetadataInterface
6677
*/
6778
protected $productMetadata;
6879

6980
/**
70-
* @var \Magento\Framework\UrlInterface
81+
* @var UrlInterface
7182
*/
7283
protected $urlBuilder;
7384

7485
/**
75-
* @param \Magento\Framework\Model\Context $context
76-
* @param \Magento\Framework\Registry $registry
77-
* @param \Magento\Backend\App\ConfigInterface $backendConfig
86+
* @param Context $context
87+
* @param Registry $registry
88+
* @param ConfigInterface $backendConfig
7889
* @param InboxFactory $inboxFactory
79-
* @param \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory
80-
* @param \Magento\Framework\App\DeploymentConfig $deploymentConfig
81-
* @param \Magento\Framework\App\ProductMetadataInterface $productMetadata
82-
* @param \Magento\Framework\UrlInterface $urlBuilder
83-
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
84-
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
90+
* @param CurlFactory $curlFactory
91+
* @param DeploymentConfig $deploymentConfig
92+
* @param ProductMetadataInterface $productMetadata
93+
* @param UrlInterface $urlBuilder
94+
* @param AbstractResource|null $resource
95+
* @param AbstractDb|null $resourceCollection
8596
* @param array $data
8697
* @param Escaper|null $escaper
8798
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8899
*/
89100
public function __construct(
90-
\Magento\Framework\Model\Context $context,
91-
\Magento\Framework\Registry $registry,
92-
\Magento\Backend\App\ConfigInterface $backendConfig,
93-
\Magento\AdminNotification\Model\InboxFactory $inboxFactory,
94-
\Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory,
95-
\Magento\Framework\App\DeploymentConfig $deploymentConfig,
96-
\Magento\Framework\App\ProductMetadataInterface $productMetadata,
97-
\Magento\Framework\UrlInterface $urlBuilder,
98-
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
99-
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
101+
Context $context,
102+
Registry $registry,
103+
ConfigInterface $backendConfig,
104+
InboxFactory $inboxFactory,
105+
CurlFactory $curlFactory,
106+
DeploymentConfig $deploymentConfig,
107+
ProductMetadataInterface $productMetadata,
108+
UrlInterface $urlBuilder,
109+
AbstractResource $resource = null,
110+
AbstractDb $resourceCollection = null,
100111
array $data = [],
101112
Escaper $escaper = null
102113
) {
@@ -210,10 +221,11 @@ public function setLastUpdate()
210221
/**
211222
* Retrieve feed data as XML element
212223
*
213-
* @return \SimpleXMLElement
224+
* @return SimpleXMLElement
214225
*/
215226
public function getFeedData()
216227
{
228+
/** @var Curl $curl */
217229
$curl = $this->curlFactory->create();
218230
$curl->setConfig(
219231
[
@@ -227,11 +239,11 @@ public function getFeedData()
227239
$curl->write(\Zend_Http_Client::GET, $this->getFeedUrl(), '1.0');
228240
$data = $curl->read();
229241
$data = preg_split('/^\r?$/m', $data, 2);
230-
$data = trim($data[1]);
242+
$data = trim($data[1] ?? '');
231243
$curl->close();
232244

233245
try {
234-
$xml = new \SimpleXMLElement($data);
246+
$xml = new SimpleXMLElement($data);
235247
} catch (\Exception $e) {
236248
return false;
237249
}
@@ -242,15 +254,15 @@ public function getFeedData()
242254
/**
243255
* Retrieve feed as XML element
244256
*
245-
* @return \SimpleXMLElement
257+
* @return SimpleXMLElement
246258
*/
247259
public function getFeedXml()
248260
{
249261
try {
250262
$data = $this->getFeedData();
251-
$xml = new \SimpleXMLElement($data);
263+
$xml = new SimpleXMLElement($data);
252264
} catch (\Exception $e) {
253-
$xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8" ?>');
265+
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8" ?>');
254266
}
255267

256268
return $xml;
@@ -259,10 +271,10 @@ public function getFeedXml()
259271
/**
260272
* Converts incoming data to string format and escapes special characters.
261273
*
262-
* @param \SimpleXMLElement $data
274+
* @param SimpleXMLElement $data
263275
* @return string
264276
*/
265-
private function escapeString(\SimpleXMLElement $data)
277+
private function escapeString(SimpleXMLElement $data)
266278
{
267279
return $this->escaper->escapeHtml((string)$data);
268280
}

app/code/Magento/AdminNotification/view/adminhtml/templates/toolbar_entry.phtml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
/** @var $this \Magento\AdminNotification\Block\ToolbarEntry */
8-
6+
// phpcs:disable Generic.Files.LineLength
7+
/** @var $block \Magento\AdminNotification\Block\ToolbarEntry */
98
$notificationCount = $block->getUnreadNotificationCount();
109
$notificationCounterMax = $block->getNotificationCounterMax();
1110
?>
1211
<div
1312
data-mage-init='{"toolbarEntry": {}}'
1413
class="notifications-wrapper admin__action-dropdown-wrap"
1514
data-notification-count="<?= (int)$notificationCount ?>">
16-
<?php if ($notificationCount > 0) : ?>
15+
<?php if ($notificationCount > 0): ?>
1716
<a
1817
href="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/index')) ?>"
1918
class="notifications-action admin__action-dropdown"
@@ -27,19 +26,19 @@
2726
<ul
2827
class="admin__action-dropdown-menu"
2928
data-mark-as-read-url="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/ajaxMarkAsRead')) ?>">
30-
<?php foreach ($block->getLatestUnreadNotifications() as $notification) : ?>
29+
<?php foreach ($block->getLatestUnreadNotifications() as $notification): ?>
3130
<?php /** @var $notification \Magento\AdminNotification\Model\Inbox */ ?>
32-
<li class="notifications-entry<?php if ($notification->getSeverity() == 1) : ?> notifications-critical<?php endif; ?>"
31+
<li class="notifications-entry<?php if ($notification->getSeverity() == 1): ?> notifications-critical<?php endif; ?>"
3332
data-notification-id="<?= $block->escapeHtmlAttr($notification->getId()) ?>"
34-
data-notification-severity="<?php if ($notification->getSeverity() == 1) : ?>1<?php endif; ?>">
33+
data-notification-severity="<?php if ($notification->getSeverity() == 1): ?>1<?php endif; ?>">
3534
<?php
36-
$notificationDescription = $notification->getDescription();
35+
$notificationDescription = $notification->getDescription() ?? '';
3736
$notificationDescriptionLength = $block->getNotificationDescriptionLength();
3837
?>
3938
<strong class="notifications-entry-title">
4039
<?= $block->escapeHtml($notification->getTitle()) ?>
4140
</strong>
42-
<?php if (strlen($notificationDescription) > $notificationDescriptionLength) : ?>
41+
<?php if (strlen($notificationDescription) > $notificationDescriptionLength): ?>
4342
<p class="notifications-entry-description _cutted">
4443
<span class="notifications-entry-description-start">
4544
<?= $block->escapeHtml(substr($notificationDescription, 0, $notificationDescriptionLength)) ?>
@@ -48,7 +47,7 @@
4847
<?= $block->escapeHtml(substr($notificationDescription, $notificationDescriptionLength)) ?>
4948
</span>
5049
</p>
51-
<?php else : ?>
50+
<?php else: ?>
5251
<p class="notifications-entry-description">
5352
<?= $block->escapeHtml($notificationDescription) ?>
5453
</p>
@@ -71,7 +70,7 @@
7170
</a>
7271
</li>
7372
</ul>
74-
<?php else : ?>
73+
<?php else: ?>
7574
<a
7675
class="notifications-action admin__action-dropdown"
7776
href="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/index')) ?>"

app/code/Magento/AdobeIms/Model/Config.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function getAuthUrl(): string
8181
return str_replace(
8282
['#{client_id}', '#{redirect_uri}', '#{locale}'],
8383
[$this->getApiKey(), $this->getCallBackUrl(), $this->getLocale()],
84-
$this->scopeConfig->getValue(self::XML_PATH_AUTH_URL_PATTERN)
84+
$this->scopeConfig->getValue(self::XML_PATH_AUTH_URL_PATTERN) ?? ''
8585
);
8686
}
8787

@@ -111,7 +111,7 @@ public function getLogoutUrl(string $accessToken, string $redirectUrl = '') : st
111111
return str_replace(
112112
['#{access_token}', '#{redirect_uri}'],
113113
[$accessToken, $redirectUrl],
114-
$this->scopeConfig->getValue(self::XML_PATH_LOGOUT_URL_PATTERN)
114+
$this->scopeConfig->getValue(self::XML_PATH_LOGOUT_URL_PATTERN) ?? ''
115115
);
116116
}
117117

@@ -123,7 +123,7 @@ public function getProfileImageUrl(): string
123123
return str_replace(
124124
['#{api_key}'],
125125
[$this->getApiKey()],
126-
$this->scopeConfig->getValue(self::XML_PATH_IMAGE_URL_PATTERN)
126+
$this->scopeConfig->getValue(self::XML_PATH_IMAGE_URL_PATTERN) ?? ''
127127
);
128128
}
129129
}

app/code/Magento/AdvancedSearch/Model/Recommendations/SaveSearchQueryRelationsObserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function execute(EventObserver $observer)
3535
{
3636
$searchQueryModel = $observer->getEvent()->getDataObject();
3737
$queryId = $searchQueryModel->getId();
38-
$relatedQueries = $searchQueryModel->getSelectedQueriesGrid();
38+
$relatedQueries = $searchQueryModel->getSelectedQueriesGrid() ?? '';
3939

4040
if (strlen($relatedQueries) == 0) {
4141
$relatedQueries = [];

0 commit comments

Comments
 (0)