Skip to content

Commit ba96d6e

Browse files
committed
Merge remote-tracking branch 'mainline/2.4-develop' into adobe-ims
2 parents 971e6a4 + 43bc8de commit ba96d6e

File tree

944 files changed

+9493
-1285
lines changed

Some content is hidden

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

944 files changed

+9493
-1285
lines changed

app/code/Magento/AdvancedSearch/Block/SearchDataInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\AdvancedSearch\Block;
79

810
/**
911
* Interface \Magento\AdvancedSearch\Block\SearchDataInterface
1012
*
13+
* @api
1114
*/
1215
interface SearchDataInterface
1316
{

app/code/Magento/Analytics/Api/Data/LinkInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Analytics\Api\Data;
79

810
/**
911
* Represents link with collected data and initialized vector for decryption.
12+
*
13+
* @api
1014
*/
1115
interface LinkInterface
1216
{

app/code/Magento/Analytics/Api/LinkProviderInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Analytics\Api;
79

810
/**
911
* Provides link to file with collected report data.
12+
*
13+
* @api
1014
*/
1115
interface LinkProviderInterface
1216
{

app/code/Magento/Analytics/Model/Connector/CommandInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Analytics\Model\Connector;
79

810
/**
911
* Introduces family of integration calls.
1012
* Each implementation represents call to external service.
13+
*
14+
* @api
1115
*/
1216
interface CommandInterface
1317
{

app/code/Magento/Analytics/Model/ExportDataHandlerInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Analytics\Model;
79

810
/**
911
* The interface represents the type of classes that handling of a new data collection for MBI.
12+
*
13+
* @api
1014
*/
1115
interface ExportDataHandlerInterface
1216
{

app/code/Magento/Analytics/Model/ReportWriterInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Analytics\Model;
79

810
use Magento\Framework\Filesystem\Directory\WriteInterface;
@@ -14,6 +16,8 @@
1416
* Executes export of collected data
1517
* Iterates registered providers @see etc/analytics.xml
1618
* Collects data (to TMP folder)
19+
*
20+
* @api
1721
*/
1822
interface ReportWriterInterface
1923
{

app/code/Magento/Analytics/ReportXml/DB/Assembler/AssemblerInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Analytics\ReportXml\DB\Assembler;
79

810
use Magento\Analytics\ReportXml\DB\SelectBuilder;
@@ -13,6 +15,8 @@
1315
* Introduces family of SQL assemblers
1416
* Each assembler populates SelectBuilder with config information
1517
* @see usage examples at \Magento\Analytics\ReportXml\QueryFactory
18+
*
19+
* @api
1620
*/
1721
interface AssemblerInterface
1822
{

app/code/Magento/Analytics/ReportXml/DB/SelectBuilder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* Responsible for Select object creation, works as a builder. Returns Select as result;
1414
*
1515
* Used in SQL assemblers.
16+
*
17+
* @api
1618
*/
1719
class SelectBuilder
1820
{
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Authorization\Test\Fixture;
9+
10+
use Magento\Authorization\Model\Acl\Role\Group;
11+
use Magento\Authorization\Model\ResourceModel\Role as RoleResource;
12+
use Magento\Authorization\Model\UserContextInterface;
13+
use Magento\Framework\DataObject;
14+
use Magento\SharedCatalog\Model\SharedCatalogFactory;
15+
use Magento\TestFramework\Fixture\Data\ProcessorInterface;
16+
use Magento\TestFramework\Fixture\RevertibleDataFixtureInterface;
17+
use Magento\Authorization\Model\RoleFactory;
18+
use Magento\Authorization\Model\RulesFactory;
19+
use Magento\User\Model\UserFactory;
20+
21+
/**
22+
* Creating a new admin role
23+
*/
24+
class Role implements RevertibleDataFixtureInterface
25+
{
26+
private const DEFAULT_DATA = [
27+
'role_name' => 'Role Name %uniqid%',
28+
'role_type' => Group::ROLE_TYPE,
29+
'user_id' => 0,
30+
'user_type' => UserContextInterface::USER_TYPE_ADMIN
31+
];
32+
33+
private const DEFAULT_DATA_RULES = [
34+
'id' => null,
35+
'role_id' => null,
36+
'resources' => ['Magento_Backend::all']
37+
];
38+
39+
/**
40+
* @var RoleFactory
41+
*/
42+
private $roleFactory;
43+
44+
/**
45+
* @var ProcessorInterface
46+
*/
47+
private $dataProcessor;
48+
49+
/**
50+
* @var RoleResource
51+
*/
52+
private $roleResourceModel;
53+
54+
/**
55+
* @var RulesFactory
56+
*/
57+
private $rulesFactory;
58+
59+
/**
60+
* @param RoleFactory $roleFactory
61+
* @param RoleResource $roleResourceModel
62+
* @param RulesFactory $rulesFactory
63+
* @param ProcessorInterface $dataProcessor
64+
*/
65+
public function __construct(
66+
RoleFactory $roleFactory,
67+
RoleResource $roleResourceModel,
68+
RulesFactory $rulesFactory,
69+
ProcessorInterface $dataProcessor
70+
) {
71+
$this->roleFactory = $roleFactory;
72+
$this->roleResourceModel = $roleResourceModel;
73+
$this->rulesFactory = $rulesFactory;
74+
$this->dataProcessor = $dataProcessor;
75+
}
76+
77+
/**
78+
* @inheritdoc
79+
*/
80+
public function apply(array $data = []): ?DataObject
81+
{
82+
$role = $this->roleFactory->create();
83+
$role->setData($this->prepareData(array_diff_key($data, self::DEFAULT_DATA_RULES)));
84+
$this->roleResourceModel->save($role);
85+
86+
$rules = $this->rulesFactory->create();
87+
$rules->setRoleId($role->getId() ?? null);
88+
$rules->setResources($data['resources'] ?? self::DEFAULT_DATA_RULES['resources']);
89+
$rules->saveRel();
90+
91+
return $role;
92+
}
93+
94+
/**
95+
* @inheritdoc
96+
*/
97+
public function revert(DataObject $data): void
98+
{
99+
$role = $this->roleFactory->create();
100+
$role->load($data->getId());
101+
102+
if ($role->getId() !== null) {
103+
$role->delete();
104+
}
105+
}
106+
107+
/**
108+
* Prepare admin role data
109+
*
110+
* @param array $data
111+
* @return array
112+
*/
113+
private function prepareData(array $data): array
114+
{
115+
$data = array_merge(self::DEFAULT_DATA, $data);
116+
return $this->dataProcessor->process($this, $data);
117+
}
118+
}

app/code/Magento/Backend/Model/Image/UploadResizeConfigInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* Interface UploadResizeConfigInterface
1212
*
1313
* Used to retrieve configuration for frontend image uploader
14+
*
15+
* @api
1416
*/
1517
interface UploadResizeConfigInterface
1618
{

0 commit comments

Comments
 (0)