Skip to content

Commit ca076e6

Browse files
authored
Merge pull request #1696 from sivaschenko/various-imporvements
Various improvements
2 parents 528aff6 + 37c1553 commit ca076e6

File tree

50 files changed

+117
-138
lines changed

Some content is hidden

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

50 files changed

+117
-138
lines changed

AdobeStockAdminUi/Controller/Adminhtml/System/Config/TestConnection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function execute() : ResultInterface
8888
$message = __('An error occurred during test Adobe Stock API connection');
8989
$isConnectionEstablished = false;
9090
}
91-
/** @var Json $resultJson */
91+
9292
$resultJson = $this->resultJsonFactory->create();
9393
return $resultJson->setData(
9494
[

AdobeStockAsset/Model/AppendAttributes.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\Api\AttributeValueFactory;
1212
use Magento\Framework\Api\Search\Document;
1313
use Magento\Framework\Api\Search\SearchResultInterface;
14-
use Magento\MediaGalleryApi\Model\Asset\Command\GetByIdInterface;
14+
use Magento\MediaGalleryApi\Api\GetAssetsByIdsInterface;
1515

1616
/**
1717
* Class is used for adding an additional assets attributes such as is_downloaded or path to the search results
@@ -33,23 +33,23 @@ class AppendAttributes
3333
private $loadByIds;
3434

3535
/**
36-
* @var GetByIdInterface
36+
* @var GetAssetsByIdsInterface
3737
*/
38-
private $getMediaGalleryAssetById;
38+
private $getMediaGalleryAssetsByIds;
3939

4040
/**
4141
* @param AttributeValueFactory $attributeValueFactory
4242
* @param LoadByIdsInterface $loadByIds
43-
* @param GetByIdInterface $getMediaGalleryAssetById
43+
* @param GetAssetsByIdsInterface $getMediaGalleryAssetById
4444
*/
4545
public function __construct(
4646
AttributeValueFactory $attributeValueFactory,
4747
LoadByIdsInterface $loadByIds,
48-
GetByIdInterface $getMediaGalleryAssetById
48+
GetAssetsByIdsInterface $getMediaGalleryAssetById
4949
) {
5050
$this->attributeValueFactory = $attributeValueFactory;
5151
$this->loadByIds = $loadByIds;
52-
$this->getMediaGalleryAssetById = $getMediaGalleryAssetById;
52+
$this->getMediaGalleryAssetsByIds = $getMediaGalleryAssetById;
5353
}
5454

5555
/**
@@ -89,9 +89,9 @@ static function ($item) {
8989
continue;
9090
}
9191

92-
$path = $this->getMediaGalleryAssetById->execute(
93-
$assets[$item->getId()]->getMediaGalleryId()
94-
)->getPath();
92+
$path = $this->getMediaGalleryAssetsByIds->execute(
93+
[$assets[$item->getId()]->getMediaGalleryId()]
94+
)[0]->getPath();
9595

9696
$this->addAttributes(
9797
$item,

AdobeStockAsset/Model/AssetRepository.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ public function save(AssetInterface $asset): void
116116
public function getList(SearchCriteriaInterface $searchCriteria): AssetSearchResultsInterface
117117
{
118118
try {
119-
/** @var AssetCollection $collection */
120119
$collection = $this->collectionFactory->create();
121120
$this->joinProcessor->process(
122121
$collection,
@@ -125,7 +124,6 @@ public function getList(SearchCriteriaInterface $searchCriteria): AssetSearchRes
125124

126125
$this->collectionProcessor->process($searchCriteria, $collection);
127126

128-
/** @var AssetSearchResultsInterface $searchResults */
129127
$searchResults = $this->searchResultFactory->create();
130128
$searchResults->setItems($collection->getItems());
131129
$searchResults->setSearchCriteria($searchCriteria);

AdobeStockAsset/Model/CategoryRepository.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ public function delete(CategoryInterface $item): void
116116
*/
117117
public function getList(SearchCriteriaInterface $searchCriteria) : CategorySearchResultsInterface
118118
{
119-
/** @var CategoryCollection $collection */
120119
$collection = $this->collectionFactory->create();
121120
$this->joinProcessor->process(
122121
$collection,
@@ -125,7 +124,6 @@ public function getList(SearchCriteriaInterface $searchCriteria) : CategorySearc
125124

126125
$this->collectionProcessor->process($searchCriteria, $collection);
127126

128-
/** @var CategorySearchResultsInterface $searchResults */
129127
$searchResults = $this->searchResultFactory->create();
130128
$searchResults->setItems($collection->getItems());
131129
$searchResults->setSearchCriteria($searchCriteria);

AdobeStockAsset/Model/CreatorRepository.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public function delete(CreatorInterface $item): void
113113
*/
114114
public function getList(SearchCriteriaInterface $searchCriteria) : CreatorSearchResultsInterface
115115
{
116-
/** @var CreatorCollection $collection */
117116
$collection = $this->collectionFactory->create();
118117
$this->joinProcessor->process(
119118
$collection,
@@ -122,7 +121,6 @@ public function getList(SearchCriteriaInterface $searchCriteria) : CreatorSearch
122121

123122
$this->collectionProcessor->process($searchCriteria, $collection);
124123

125-
/** @var CreatorSearchResultsInterface $searchResults */
126124
$searchResults = $this->searchResultFactory->create();
127125
$searchResults->setItems($collection->getItems());
128126
$searchResults->setSearchCriteria($searchCriteria);

AdobeStockAsset/Model/ResourceModel/Asset/Command/DeleteById.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public function __construct(
5757
public function execute(int $adobeStockAssetId): void
5858
{
5959
try {
60-
/** @var AdapterInterface $connection */
6160
$connection = $this->resourceConnection->getConnection();
6261
$tableName = $this->resourceConnection->getTableName(self::ADOBE_STOCK_ASSET_TABLE_NAME);
6362
$connection->delete($tableName, [self::ADOBE_STOCK_ASSET_ID . ' = ?' => $adobeStockAssetId]);

AdobeStockAsset/Model/ResourceModel/Category/Command/DeleteById.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public function __construct(
5757
public function execute(int $categoryId): void
5858
{
5959
try {
60-
/** @var AdapterInterface $connection */
6160
$connection = $this->resourceConnection->getConnection();
6261
$tableName = $this->resourceConnection->getTableName(self::ADOBE_STOCK_ASSET_CATEGORY_TABLE_NAME);
6362
$connection->delete($tableName, [self::ADOBE_STOCK_ASSET_CATEGORY_ID . ' = ?' => $categoryId]);

AdobeStockAsset/Model/ResourceModel/Creator/Command/DeleteById.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public function __construct(
5757
public function execute(int $creatorId): void
5858
{
5959
try {
60-
/** @var AdapterInterface $connection */
6160
$connection = $this->resourceConnection->getConnection();
6261
$tableName = $this->resourceConnection->getTableName(self::ADOBE_STOCK_ASSET_CREATOR_TABLE_NAME);
6362
$connection->delete($tableName, [self::ADOBE_STOCK_ASSET_CREATOR_ID . ' = ?' => $creatorId]);

AdobeStockAsset/Test/Api/AssetRepository/GetListTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public function testGetList(): void
5353
/** @var SortOrderBuilder $sortOrderBuilder */
5454
$sortOrderBuilder = Bootstrap::getObjectManager()->create(SortOrderBuilder::class);
5555

56-
/** @var SortOrder $sortOrder */
5756
$sortOrder = $sortOrderBuilder->setField('id')
5857
->setDirection(SortOrder::SORT_DESC)
5958
->create();

AdobeStockAsset/Test/Api/SearchAdobeStockTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ public function testGetList(): void
6868

6969
/** @var SortOrderBuilder $sortOrderBuilder */
7070
$sortOrderBuilder = Bootstrap::getObjectManager()->create(SortOrderBuilder::class);
71-
/** @var SortOrder $sortOrder */
7271
$sortOrder = $sortOrderBuilder->setField('id')
7372
->setDirection(SortOrder::SORT_DESC)
7473
->create();

0 commit comments

Comments
 (0)