Skip to content

Commit 09964ae

Browse files
Merge branch '2.4-develop' into issue-27954/forgot-password
2 parents 4f8f9f2 + a1e5689 commit 09964ae

File tree

64 files changed

+1188
-190
lines changed

Some content is hidden

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

64 files changed

+1188
-190
lines changed

.github/stale.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Configuration for probot-stale - https://github.com/probot/stale
22

33
# Number of days of inactivity before an Issue or Pull Request becomes stale
4-
daysUntilStale: 76
4+
daysUntilStale: 76
55

66
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
77
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
@@ -18,7 +18,7 @@ exemptLabels:
1818
- "Progress: dev in progress"
1919
- "Progress: PR in progress"
2020
- "Progress: done"
21-
- "B2B: GraphQL"
21+
- "B2B: GraphQL"
2222
- "Progress: PR Created"
2323
- "PAP"
2424
- "Project: Login as Customer"

app/code/Magento/AdminNotification/Block/ToolbarEntry.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
* Toolbar entry that shows latest notifications
1111
*
1212
* @api
13-
* @author Magento Core Team <[email protected]>
1413
* @since 100.0.2
1514
*/
1615
class ToolbarEntry extends \Magento\Backend\Block\Template

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
/**
1313
* AdminNotification Feed model
1414
*
15-
* @author Magento Core Team <[email protected]>
1615
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1716
* @api
1817
* @since 100.0.2

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
/**
99
* AdminNotification Inbox interface
1010
*
11-
* @author Magento Core Team <[email protected]>
1211
* @api
1312
* @since 100.0.2
1413
*/

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
/**
99
* Notification service model
1010
*
11-
* @author Magento Core Team <[email protected]>
1211
* @api
1312
* @since 100.0.2
1413
*/

app/code/Magento/AdminNotification/Model/ResourceModel/Grid/Collection.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
/**
88
* AdminNotification Inbox model
9-
*
10-
* @author Magento Core Team <[email protected]>
119
*/
1210
namespace Magento\AdminNotification\Model\ResourceModel\Grid;
1311

app/code/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
* AdminNotification Inbox model
1010
*
1111
* @api
12-
* @author Magento Core Team <[email protected]>
13-
* @api
1412
* @since 100.0.2
1513
*/
1614
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection

app/code/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection/Unread.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
/**
88
* Collection of unread notifications
9-
*
10-
* @author Magento Core Team <[email protected]>
119
*/
1210
namespace Magento\AdminNotification\Model\ResourceModel\Inbox\Collection;
1311

app/code/Magento/AdminNotification/Observer/PredispatchAdminActionControllerObserver.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
/**
1111
* AdminNotification observer
12-
*
13-
* @author Magento Core Team <[email protected]>
12+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1413
*/
1514
class PredispatchAdminActionControllerObserver implements ObserverInterface
1615
{

app/code/Magento/AdvancedSearch/Block/Adminhtml/Search/Edit.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Search queries relations grid container
1010
*
1111
* @api
12-
* @author Magento Core Team <[email protected]>
1312
* @since 100.0.2
1413
*/
1514
class Edit extends \Magento\Backend\Block\Widget\Grid\Container

app/code/Magento/AdvancedSearch/Block/Adminhtml/Search/Grid.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Search query relations edit grid
1010
*
1111
* @api
12-
* @author Magento Core Team <[email protected]>
1312
* @since 100.0.2
1413
*/
1514
class Grid extends \Magento\Backend\Block\Widget\Grid

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
/**
99
* Catalog search recommendations resource model
1010
*
11-
* @author Magento Core Team <[email protected]>
1211
* @api
1312
* @since 100.0.2
1413
*/

app/code/Magento/Catalog/Model/CategoryRepository.php

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@
77

88
namespace Magento\Catalog\Model;
99

10+
use Magento\Catalog\Model\CategoryRepository\PopulateWithValues;
11+
use Magento\Catalog\Model\ResourceModel\Category as CategoryResource;
12+
use Magento\Framework\Api\ExtensibleDataObjectConverter;
13+
use Magento\Framework\App\ObjectManager;
14+
use Magento\Framework\EntityManager\MetadataPool;
1015
use Magento\Framework\Exception\CouldNotSaveException;
1116
use Magento\Framework\Exception\NoSuchEntityException;
1217
use Magento\Framework\Exception\StateException;
1318
use Magento\Catalog\Api\Data\CategoryInterface;
19+
use Magento\Store\Model\StoreManagerInterface;
1420

1521
/**
1622
* Repository for categories.
@@ -25,27 +31,27 @@ class CategoryRepository implements \Magento\Catalog\Api\CategoryRepositoryInter
2531
protected $instances = [];
2632

2733
/**
28-
* @var \Magento\Store\Model\StoreManagerInterface
34+
* @var StoreManagerInterface
2935
*/
3036
protected $storeManager;
3137

3238
/**
33-
* @var \Magento\Catalog\Model\CategoryFactory
39+
* @var CategoryFactory
3440
*/
3541
protected $categoryFactory;
3642

3743
/**
38-
* @var \Magento\Catalog\Model\ResourceModel\Category
44+
* @var CategoryResource
3945
*/
4046
protected $categoryResource;
4147

4248
/**
43-
* @var \Magento\Framework\EntityManager\MetadataPool
49+
* @var MetadataPool
4450
*/
4551
protected $metadataPool;
4652

4753
/**
48-
* @var \Magento\Framework\Api\ExtensibleDataObjectConverter
54+
* @var ExtensibleDataObjectConverter
4955
*/
5056
private $extensibleDataObjectConverter;
5157

@@ -57,28 +63,37 @@ class CategoryRepository implements \Magento\Catalog\Api\CategoryRepositoryInter
5763
protected $useConfigFields = ['available_sort_by', 'default_sort_by', 'filter_price_range'];
5864

5965
/**
60-
* @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
61-
* @param \Magento\Catalog\Model\ResourceModel\Category $categoryResource
62-
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
66+
* @var PopulateWithValues
67+
*/
68+
private $populateWithValues;
69+
70+
/**
71+
* @param CategoryFactory $categoryFactory
72+
* @param CategoryResource $categoryResource
73+
* @param StoreManagerInterface $storeManager
74+
* @param PopulateWithValues|null $populateWithValues
6375
*/
6476
public function __construct(
65-
\Magento\Catalog\Model\CategoryFactory $categoryFactory,
66-
\Magento\Catalog\Model\ResourceModel\Category $categoryResource,
67-
\Magento\Store\Model\StoreManagerInterface $storeManager
77+
CategoryFactory $categoryFactory,
78+
CategoryResource $categoryResource,
79+
StoreManagerInterface $storeManager,
80+
?PopulateWithValues $populateWithValues
6881
) {
6982
$this->categoryFactory = $categoryFactory;
7083
$this->categoryResource = $categoryResource;
7184
$this->storeManager = $storeManager;
85+
$objectManager = ObjectManager::getInstance();
86+
$this->populateWithValues = $populateWithValues ?? $objectManager->get(PopulateWithValues::class);
7287
}
7388

7489
/**
7590
* @inheritdoc
7691
*/
77-
public function save(\Magento\Catalog\Api\Data\CategoryInterface $category)
92+
public function save(CategoryInterface $category)
7893
{
7994
$storeId = (int)$this->storeManager->getStore()->getId();
8095
$existingData = $this->getExtensibleDataObjectConverter()
81-
->toNestedArray($category, [], \Magento\Catalog\Api\Data\CategoryInterface::class);
96+
->toNestedArray($category, [], CategoryInterface::class);
8297
$existingData = array_diff_key($existingData, array_flip(['path', 'level', 'parent_id']));
8398
$existingData['store_id'] = $storeId;
8499

@@ -110,7 +125,7 @@ public function save(\Magento\Catalog\Api\Data\CategoryInterface $category)
110125
$existingData['parent_id'] = $parentId;
111126
$existingData['level'] = null;
112127
}
113-
$category->addData($existingData);
128+
$this->populateWithValues->execute($category, $existingData);
114129
try {
115130
$this->validateCategory($category);
116131
$this->categoryResource->save($category);
@@ -151,7 +166,7 @@ public function get($categoryId, $storeId = null)
151166
/**
152167
* @inheritdoc
153168
*/
154-
public function delete(\Magento\Catalog\Api\Data\CategoryInterface $category)
169+
public function delete(CategoryInterface $category)
155170
{
156171
try {
157172
$categoryId = $category->getId();
@@ -213,29 +228,29 @@ protected function validateCategory(Category $category)
213228
/**
214229
* Lazy loader for the converter.
215230
*
216-
* @return \Magento\Framework\Api\ExtensibleDataObjectConverter
231+
* @return ExtensibleDataObjectConverter
217232
*
218233
* @deprecated 101.0.0
219234
*/
220235
private function getExtensibleDataObjectConverter()
221236
{
222237
if ($this->extensibleDataObjectConverter === null) {
223-
$this->extensibleDataObjectConverter = \Magento\Framework\App\ObjectManager::getInstance()
224-
->get(\Magento\Framework\Api\ExtensibleDataObjectConverter::class);
238+
$this->extensibleDataObjectConverter = ObjectManager::getInstance()
239+
->get(ExtensibleDataObjectConverter::class);
225240
}
226241
return $this->extensibleDataObjectConverter;
227242
}
228243

229244
/**
230245
* Lazy loader for the metadata pool.
231246
*
232-
* @return \Magento\Framework\EntityManager\MetadataPool
247+
* @return MetadataPool
233248
*/
234249
private function getMetadataPool()
235250
{
236251
if (null === $this->metadataPool) {
237-
$this->metadataPool = \Magento\Framework\App\ObjectManager::getInstance()
238-
->get(\Magento\Framework\EntityManager\MetadataPool::class);
252+
$this->metadataPool = ObjectManager::getInstance()
253+
->get(MetadataPool::class);
239254
}
240255
return $this->metadataPool;
241256
}

0 commit comments

Comments
 (0)