From 4766b886077fde67d45bedb3fe5bfa1c8708400e Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 18 Feb 2021 02:18:25 +0700 Subject: [PATCH] Remove deprecated interfaces part 1 #32061 --- .../AdvancedSearch/Block/SearchData.php | 2 +- .../Test/Unit/Block/SearchDataTest.php | 2 +- .../Product/StatusBaseSelectProcessor.php | 3 - .../ResourceModel/Advanced/Collection.php | 31 +---- .../ResourceModel/Fulltext/Collection.php | 40 +----- .../DefaultFilterStrategyApplyChecker.php | 24 ---- ...ultFilterStrategyApplyCheckerInterface.php | 21 ---- .../Block/Checkout/DirectoryDataProcessor.php | 3 - .../Checkout/DirectoryDataProcessorTest.php | 2 +- .../DefaultFilterStrategyApplyChecker.php | 26 ---- app/code/Magento/Elasticsearch/etc/di.xml | 4 +- .../Model/ExtractAssetsFromContent.php | 4 +- .../Asset/Command/DeleteByDirectoryPath.php | 94 -------------- .../Model/Asset/Command/DeleteByPath.php | 76 ------------ .../Model/Asset/Command/GetById.php | 117 ------------------ .../Model/Asset/Command/GetByPath.php | 106 ---------------- .../MediaGallery/Model/Asset/Command/Save.php | 91 -------------- .../Keyword/Command/GetAssetKeywords.php | 95 -------------- .../Keyword/Command/SaveAssetKeywords.php | 111 ----------------- .../Command/DeleteByDirectoryPathTest.php | 6 +- .../Model/Asset/Command/DeleteByPathTest.php | 6 +- ...tionDuringMediaAssetInitializationTest.php | 4 +- .../GetByIdExceptionNoSuchEntityTest.php | 4 +- .../Command/GetByIdExceptionOnGetDataTest.php | 4 +- .../Asset/Command/GetByIdSuccessfulTest.php | 4 +- .../Unit/Model/Asset/Command/SaveTest.php | 6 +- .../Keyword/Command/GetAssetKeywordsTest.php | 6 +- .../Keyword/Command/SaveAssetKeywordsTest.php | 6 +- app/code/Magento/MediaGallery/etc/di.xml | 8 -- .../DeleteByDirectoryPathInterface.php | 26 ---- .../Asset/Command/DeleteByPathInterface.php | 25 ---- .../Model/Asset/Command/GetByIdInterface.php | 27 ---- .../Asset/Command/GetByPathInterface.php | 25 ---- .../Model/Asset/Command/SaveInterface.php | 28 ----- .../Command/GetAssetKeywordsInterface.php | 24 ---- .../Command/SaveAssetKeywordsInterface.php | 25 ---- .../Payment/Model/Method/ConfigInterface.php | 15 --- .../Model/Method/Online/GatewayInterface.php | 2 +- .../Test/Unit/Block/Transparent/FormTest.php | 2 +- .../Magento/Paypal/Model/AbstractConfig.php | 2 +- .../Paypal/Model/Payflow/Service/Gateway.php | 2 +- .../Paypal/Model/Payflow/Transparent.php | 2 +- app/code/Magento/Paypal/Model/Payflowlink.php | 2 +- app/code/Magento/Paypal/Model/Payflowpro.php | 4 +- .../Model/Payflow/Service/GatewayTest.php | 2 +- .../Response/Validator/AVSResponseTest.php | 2 +- .../Response/Validator/CVV2MatchTest.php | 2 +- .../Unit/Model/Payflow/TransparentTest.php | 4 +- .../Test/Unit/Model/PayflowlinkTest.php | 2 +- .../Paypal/Test/Unit/Model/PayflowproTest.php | 4 +- app/code/Magento/Paypal/etc/di.xml | 4 +- .../Magento/Search/Model/QueryFactory.php | 2 +- .../Search/Model/QueryFactoryInterface.php | 18 --- app/code/Magento/Search/etc/di.xml | 2 +- .../Store/Controller/Store/Redirect.php | 2 +- app/code/Magento/Store/Model/StoreManager.php | 2 +- .../Magento/Store/Model/StoreResolver.php | 2 +- .../Model/StoreSwitcher/CleanTargetUrl.php | 2 +- .../Unit/Controller/Store/RedirectTest.php | 2 +- .../Test/Unit/Model/StoreManagerTest.php | 2 +- app/code/Magento/Store/etc/di.xml | 1 - .../GraphQl/Store/StoreConfigResolverTest.php | 2 +- .../Paypal/Model/PayflowproVoidTest.php | 2 +- .../Controller/Store/SwitchActionTest.php | 2 +- 64 files changed, 63 insertions(+), 1115 deletions(-) delete mode 100644 app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/DefaultFilterStrategyApplyChecker.php delete mode 100644 app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/DefaultFilterStrategyApplyCheckerInterface.php delete mode 100644 app/code/Magento/Elasticsearch/Model/ResourceModel/Fulltext/Collection/DefaultFilterStrategyApplyChecker.php delete mode 100644 app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByDirectoryPath.php delete mode 100644 app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByPath.php delete mode 100644 app/code/Magento/MediaGallery/Model/Asset/Command/GetById.php delete mode 100644 app/code/Magento/MediaGallery/Model/Asset/Command/GetByPath.php delete mode 100644 app/code/Magento/MediaGallery/Model/Asset/Command/Save.php delete mode 100644 app/code/Magento/MediaGallery/Model/Keyword/Command/GetAssetKeywords.php delete mode 100644 app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetKeywords.php delete mode 100644 app/code/Magento/MediaGalleryApi/Model/Asset/Command/DeleteByDirectoryPathInterface.php delete mode 100644 app/code/Magento/MediaGalleryApi/Model/Asset/Command/DeleteByPathInterface.php delete mode 100644 app/code/Magento/MediaGalleryApi/Model/Asset/Command/GetByIdInterface.php delete mode 100644 app/code/Magento/MediaGalleryApi/Model/Asset/Command/GetByPathInterface.php delete mode 100644 app/code/Magento/MediaGalleryApi/Model/Asset/Command/SaveInterface.php delete mode 100644 app/code/Magento/MediaGalleryApi/Model/Keyword/Command/GetAssetKeywordsInterface.php delete mode 100644 app/code/Magento/MediaGalleryApi/Model/Keyword/Command/SaveAssetKeywordsInterface.php delete mode 100644 app/code/Magento/Payment/Model/Method/ConfigInterface.php delete mode 100644 app/code/Magento/Search/Model/QueryFactoryInterface.php diff --git a/app/code/Magento/AdvancedSearch/Block/SearchData.php b/app/code/Magento/AdvancedSearch/Block/SearchData.php index 105a1c1c4fc46..92efdee617d73 100644 --- a/app/code/Magento/AdvancedSearch/Block/SearchData.php +++ b/app/code/Magento/AdvancedSearch/Block/SearchData.php @@ -6,7 +6,7 @@ namespace Magento\AdvancedSearch\Block; use Magento\Framework\View\Element\Template; -use Magento\Search\Model\QueryFactoryInterface; +use Magento\Search\Model\QueryFactory as QueryFactoryInterface; use Magento\Search\Model\QueryInterface; use Magento\AdvancedSearch\Model\SuggestedQueriesInterface; diff --git a/app/code/Magento/AdvancedSearch/Test/Unit/Block/SearchDataTest.php b/app/code/Magento/AdvancedSearch/Test/Unit/Block/SearchDataTest.php index a677094d5d3d0..ae4559406e2bc 100644 --- a/app/code/Magento/AdvancedSearch/Test/Unit/Block/SearchDataTest.php +++ b/app/code/Magento/AdvancedSearch/Test/Unit/Block/SearchDataTest.php @@ -10,7 +10,7 @@ use Magento\AdvancedSearch\Block\SearchData; use Magento\AdvancedSearch\Model\SuggestedQueriesInterface; use Magento\Framework\View\Element\Template\Context as TemplateContext; -use Magento\Search\Model\QueryFactoryInterface; +use Magento\Search\Model\QueryFactory as QueryFactoryInterface; use Magento\Search\Model\QueryInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/StatusBaseSelectProcessor.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/StatusBaseSelectProcessor.php index c5c656b726528..6b262b0467989 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/StatusBaseSelectProcessor.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/StatusBaseSelectProcessor.php @@ -11,7 +11,6 @@ use Magento\Eav\Model\Config; use Magento\Framework\DB\Select; use Magento\Framework\EntityManager\MetadataPool; -use Magento\Store\Api\StoreResolverInterface; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; @@ -38,7 +37,6 @@ class StatusBaseSelectProcessor implements BaseSelectProcessorInterface /** * @param Config $eavConfig * @param MetadataPool $metadataPool - * @param StoreResolverInterface $storeResolver * @param StoreManagerInterface $storeManager * * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -46,7 +44,6 @@ class StatusBaseSelectProcessor implements BaseSelectProcessorInterface public function __construct( Config $eavConfig, MetadataPool $metadataPool, - StoreResolverInterface $storeResolver, StoreManagerInterface $storeManager = null ) { $this->eavConfig = $eavConfig; diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php index 6005455a6ef83..0c0a3887dbd42 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php @@ -10,8 +10,6 @@ use Magento\Catalog\Model\Product; use Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitationFactory; use Magento\CatalogSearch\Model\ResourceModel\Advanced; -use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\DefaultFilterStrategyApplyChecker; -use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\DefaultFilterStrategyApplyCheckerInterface; use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\SearchCriteriaResolverFactory; use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\SearchCriteriaResolverInterface; use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\SearchResultApplierFactory; @@ -104,11 +102,6 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection */ private $searchOrders; - /** - * @var DefaultFilterStrategyApplyCheckerInterface - */ - private $defaultFilterStrategyApplyChecker; - /** * @var Advanced */ @@ -148,7 +141,6 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection * @param SearchResultApplierFactory|null $searchResultApplierFactory * @param TotalRecordsResolverFactory|null $totalRecordsResolverFactory * @param EngineResolverInterface|null $engineResolver - * @param DefaultFilterStrategyApplyCheckerInterface|null $defaultFilterStrategyApplyChecker * @param Advanced|null $advancedSearchResource * @SuppressWarnings(PHPMD.ExcessiveParameterList) * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -185,7 +177,6 @@ public function __construct( SearchResultApplierFactory $searchResultApplierFactory = null, TotalRecordsResolverFactory $totalRecordsResolverFactory = null, EngineResolverInterface $engineResolver = null, - DefaultFilterStrategyApplyCheckerInterface $defaultFilterStrategyApplyChecker = null, Advanced $advancedSearchResource = null ) { $this->searchRequestName = $searchRequestName; @@ -201,8 +192,6 @@ public function __construct( ->get(TotalRecordsResolverFactory::class); $this->engineResolver = $engineResolver ?: ObjectManager::getInstance() ->get(EngineResolverInterface::class); - $this->defaultFilterStrategyApplyChecker = $defaultFilterStrategyApplyChecker ?: ObjectManager::getInstance() - ->get(DefaultFilterStrategyApplyChecker::class); $this->advancedSearchResource = $advancedSearchResource ?: ObjectManager::getInstance() ->get(Advanced::class); parent::__construct( @@ -257,9 +246,6 @@ public function setOrder($attribute, $dir = Select::SQL_DESC) * for price aggregation process. */ $this->setSearchOrder($attribute, $dir); - if ($this->defaultFilterStrategyApplyChecker->isApplicable()) { - parent::setOrder($attribute, $dir); - } return $this; } @@ -271,15 +257,7 @@ public function setOrder($attribute, $dir = Select::SQL_DESC) public function addCategoryFilter(\Magento\Catalog\Model\Category $category) { $this->setAttributeFilterData(Category::ENTITY, 'category_ids', $category->getId()); - /** - * This changes need in backward compatible reasons for support dynamic improved algorithm - * for price aggregation process. - */ - if ($this->defaultFilterStrategyApplyChecker->isApplicable()) { - parent::addCategoryFilter($category); - } else { - $this->_productLimitationPrice(); - } + $this->_productLimitationPrice(); return $this; } @@ -291,13 +269,6 @@ public function addCategoryFilter(\Magento\Catalog\Model\Category $category) public function setVisibility($visibility) { $this->setAttributeFilterData(Product::ENTITY, 'visibility', $visibility); - /** - * This changes need in backward compatible reasons for support dynamic improved algorithm - * for price aggregation process. - */ - if ($this->defaultFilterStrategyApplyChecker->isApplicable()) { - parent::setVisibility($visibility); - } return $this; } diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php index 06dcc69ef60f5..f3b66ed06b3e8 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php @@ -6,8 +6,6 @@ namespace Magento\CatalogSearch\Model\ResourceModel\Fulltext; -use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\DefaultFilterStrategyApplyChecker; -use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\DefaultFilterStrategyApplyCheckerInterface; use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\TotalRecordsResolverInterface; use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\TotalRecordsResolverFactory; use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\SearchCriteriaResolverInterface; @@ -95,11 +93,6 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection */ private $searchOrders; - /** - * @var DefaultFilterStrategyApplyCheckerInterface - */ - private $defaultFilterStrategyApplyChecker; - /** * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory * @param \Psr\Log\LoggerInterface $logger @@ -135,7 +128,6 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection * @param SearchCriteriaResolverFactory|null $searchCriteriaResolverFactory * @param SearchResultApplierFactory|null $searchResultApplierFactory * @param TotalRecordsResolverFactory|null $totalRecordsResolverFactory - * @param DefaultFilterStrategyApplyCheckerInterface|null $defaultFilterStrategyApplyChecker * @SuppressWarnings(PHPMD.ExcessiveParameterList) * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -175,7 +167,6 @@ public function __construct( SearchCriteriaResolverFactory $searchCriteriaResolverFactory = null, SearchResultApplierFactory $searchResultApplierFactory = null, TotalRecordsResolverFactory $totalRecordsResolverFactory = null, - DefaultFilterStrategyApplyCheckerInterface $defaultFilterStrategyApplyChecker = null ) { $this->searchResultFactory = $searchResultFactory ?? \Magento\Framework\App\ObjectManager::getInstance() ->get(\Magento\Framework\Api\Search\SearchResultFactory::class); @@ -215,8 +206,6 @@ public function __construct( ->get(SearchResultApplierFactory::class); $this->totalRecordsResolverFactory = $totalRecordsResolverFactory ?: ObjectManager::getInstance() ->get(TotalRecordsResolverFactory::class); - $this->defaultFilterStrategyApplyChecker = $defaultFilterStrategyApplyChecker ?: ObjectManager::getInstance() - ->get(DefaultFilterStrategyApplyChecker::class); } /** @@ -419,9 +408,6 @@ public function addSearchFilter($query) public function setOrder($attribute, $dir = Select::SQL_DESC) { $this->setSearchOrder($attribute, $dir); - if ($this->defaultFilterStrategyApplyChecker->isApplicable()) { - parent::setOrder($attribute, $dir); - } return $this; } @@ -436,11 +422,7 @@ public function setOrder($attribute, $dir = Select::SQL_DESC) */ public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) { - if ($this->defaultFilterStrategyApplyChecker->isApplicable()) { - parent::addAttributeToSort($attribute, $dir); - } else { - $this->setOrder($attribute, $dir); - } + $this->setOrder($attribute, $dir); return $this; } @@ -629,16 +611,9 @@ public function getFacetedData($field) public function addCategoryFilter(\Magento\Catalog\Model\Category $category) { $this->addFieldToFilter('category_ids', $category->getId()); - /** - * This changes need in backward compatible reasons for support dynamic improved algorithm - * for price aggregation process. - */ - if ($this->defaultFilterStrategyApplyChecker->isApplicable()) { - parent::addCategoryFilter($category); - } else { - $this->setFlag('has_category_filter', true); - $this->_productLimitationPrice(); - } + + $this->setFlag('has_category_filter', true); + $this->_productLimitationPrice(); return $this; } @@ -652,13 +627,6 @@ public function addCategoryFilter(\Magento\Catalog\Model\Category $category) public function setVisibility($visibility) { $this->addFieldToFilter('visibility', $visibility); - /** - * This changes need in backward compatible reasons for support dynamic improved algorithm - * for price aggregation process. - */ - if ($this->defaultFilterStrategyApplyChecker->isApplicable()) { - parent::setVisibility($visibility); - } return $this; } diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/DefaultFilterStrategyApplyChecker.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/DefaultFilterStrategyApplyChecker.php deleted file mode 100644 index a7e9c237f58c3..0000000000000 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/DefaultFilterStrategyApplyChecker.php +++ /dev/null @@ -1,24 +0,0 @@ -elasticsearchSearchCriteriaResolverFactory elasticsearchSearchResultApplier\Factory elasticsearchTotalRecordsResolver\Factory - Magento\Elasticsearch\Model\ResourceModel\Fulltext\Collection\DefaultFilterStrategyApplyChecker + @@ -75,7 +75,6 @@ elasticsearchSearchCriteriaResolverFactory elasticsearchSearchResultApplier\Factory elasticsearchTotalRecordsResolver\Factory - Magento\Elasticsearch\Model\ResourceModel\Fulltext\Collection\DefaultFilterStrategyApplyChecker @@ -97,7 +96,6 @@ elasticsearchSearchCriteriaResolverFactory elasticsearchSearchResultApplier\Factory elasticsearchTotalRecordsResolver\Factory - Magento\Elasticsearch\Model\ResourceModel\Fulltext\Collection\DefaultFilterStrategyApplyChecker diff --git a/app/code/Magento/MediaContent/Model/ExtractAssetsFromContent.php b/app/code/Magento/MediaContent/Model/ExtractAssetsFromContent.php index 92248ee1debfe..edd0680a90adf 100644 --- a/app/code/Magento/MediaContent/Model/ExtractAssetsFromContent.php +++ b/app/code/Magento/MediaContent/Model/ExtractAssetsFromContent.php @@ -10,7 +10,7 @@ use Magento\MediaContentApi\Model\SearchPatternConfigInterface; use Magento\MediaContentApi\Api\ExtractAssetsFromContentInterface; use Magento\MediaGalleryApi\Api\Data\AssetInterface; -use Magento\MediaGalleryApi\Model\Asset\Command\GetByPathInterface; +use Magento\MediaGalleryApi\Api\GetAssetsByPathsInterface as GetByPathInterface; use Psr\Log\LoggerInterface; /** @@ -85,7 +85,7 @@ private function getAssetsByPaths(array $paths): array $path = trim($path, '"\''); try { /** @var AssetInterface $asset */ - $asset = $this->getMediaAssetByPath->execute($this->getPathStartingWithSlash($path)); + $asset = $this->getMediaAssetByPath->execute([$this->getPathStartingWithSlash($path)]); $assets[$asset->getId()] = $asset; } catch (\Exception $exception) { $this->logger->critical($exception); diff --git a/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByDirectoryPath.php b/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByDirectoryPath.php deleted file mode 100644 index 51e4b0c1cb24d..0000000000000 --- a/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByDirectoryPath.php +++ /dev/null @@ -1,94 +0,0 @@ -resourceConnection = $resourceConnection; - $this->logger = $logger; - } - - /** - * Delete media asset(s) by path - * - * @param string $directoryPath - * - * @return void - * - * @throws CouldNotDeleteException - */ - public function execute(string $directoryPath): void - { - $this->validateDirectoryPath($directoryPath); - try { - // Make sure that the path has a trailing slash - $directoryPath = rtrim($directoryPath, '/') . '/'; - - /** @var AdapterInterface $connection */ - $connection = $this->resourceConnection->getConnection(); - $tableName = $this->resourceConnection->getTableName(self::TABLE_MEDIA_GALLERY_ASSET); - $connection->delete($tableName, [self::MEDIA_GALLERY_ASSET_PATH . ' LIKE ?' => $directoryPath . '%']); - } catch (\Exception $exception) { - $this->logger->critical($exception); - $message = __( - 'Could not delete media assets by path %path: %error', - ['path' => $directoryPath, 'error' => $exception->getMessage()] - ); - throw new CouldNotDeleteException($message, $exception); - } - } - - /** - * Validate the directory path - * - * @param string $directoryPath - * - * @throws CouldNotDeleteException - */ - private function validateDirectoryPath(string $directoryPath): void - { - if (!$directoryPath || trim($directoryPath) === '') { - throw new CouldNotDeleteException(__('Cannot remove assets, the directory path does not exist')); - } - } -} diff --git a/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByPath.php b/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByPath.php deleted file mode 100644 index 898d31a304804..0000000000000 --- a/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByPath.php +++ /dev/null @@ -1,76 +0,0 @@ -resourceConnection = $resourceConnection; - $this->logger = $logger; - } - - /** - * Delete media asset by path - * - * @param string $mediaAssetPath - * - * @return void - * @throws CouldNotDeleteException - */ - public function execute(string $mediaAssetPath): void - { - try { - /** @var AdapterInterface $connection */ - $connection = $this->resourceConnection->getConnection(); - $tableName = $this->resourceConnection->getTableName(self::TABLE_MEDIA_GALLERY_ASSET); - $connection->delete($tableName, [self::MEDIA_GALLERY_ASSET_PATH . ' = ?' => $mediaAssetPath]); - } catch (\Exception $exception) { - $this->logger->critical($exception); - $message = __( - 'Could not delete media asset with path %path: %error', - ['path' => $mediaAssetPath, 'error' => $exception->getMessage()] - ); - throw new CouldNotDeleteException($message, $exception); - } - } -} diff --git a/app/code/Magento/MediaGallery/Model/Asset/Command/GetById.php b/app/code/Magento/MediaGallery/Model/Asset/Command/GetById.php deleted file mode 100644 index 81bcbb7fe28a8..0000000000000 --- a/app/code/Magento/MediaGallery/Model/Asset/Command/GetById.php +++ /dev/null @@ -1,117 +0,0 @@ -resourceConnection = $resourceConnection; - $this->assetFactory = $assetFactory; - $this->logger = $logger; - } - - /** - * Get media asset. - * - * @param int $mediaAssetId - * - * @return AssetInterface - * @throws NoSuchEntityException - * @throws IntegrationException - */ - public function execute(int $mediaAssetId): AssetInterface - { - try { - $mediaAssetTable = $this->resourceConnection->getTableName(self::TABLE_MEDIA_GALLERY_ASSET); - $connection = $this->resourceConnection->getConnection(); - $select = $connection->select() - ->from(['amg' => $mediaAssetTable]) - ->where('amg.id = ?', $mediaAssetId); - $mediaAssetData = $connection->query($select)->fetch(); - } catch (\Exception $exception) { - $this->logger->critical($exception); - $message = __( - 'En error occurred during get media asset data by id %id: %error', - ['id' => $mediaAssetId, 'error' => $exception->getMessage()] - ); - throw new IntegrationException($message, $exception); - } - - if (empty($mediaAssetData)) { - $message = __('There is no such media asset with id %id', ['id' => $mediaAssetId]); - throw new NoSuchEntityException($message); - } - - try { - return $this->assetFactory->create( - [ - 'id' => $mediaAssetData['id'], - 'path' => $mediaAssetData['path'], - 'title' => $mediaAssetData['title'], - 'description' => $mediaAssetData['description'], - 'source' => $mediaAssetData['source'], - 'hash' => $mediaAssetData['hash'], - 'contentType' => $mediaAssetData['content_type'], - 'width' => $mediaAssetData['width'], - 'height' => $mediaAssetData['height'], - 'size' => $mediaAssetData['size'], - 'createdAt' => $mediaAssetData['created_at'], - 'updatedAt' => $mediaAssetData['updated_at'], - ] - ); - } catch (\Exception $exception) { - $this->logger->critical($exception); - $message = __( - 'En error occurred during initialize media asset with id %id: %error', - ['id' => $mediaAssetId, 'error' => $exception->getMessage()] - ); - throw new IntegrationException($message, $exception); - } - } -} diff --git a/app/code/Magento/MediaGallery/Model/Asset/Command/GetByPath.php b/app/code/Magento/MediaGallery/Model/Asset/Command/GetByPath.php deleted file mode 100644 index aabc3986a21d4..0000000000000 --- a/app/code/Magento/MediaGallery/Model/Asset/Command/GetByPath.php +++ /dev/null @@ -1,106 +0,0 @@ -resourceConnection = $resourceConnection; - $this->mediaAssetFactory = $mediaAssetFactory; - $this->logger = $logger; - } - - /** - * Return media asset - * - * @param string $path - * - * @return AssetInterface - * @throws IntegrationException - */ - public function execute(string $path): AssetInterface - { - try { - $connection = $this->resourceConnection->getConnection(); - $select = $connection->select() - ->from($this->resourceConnection->getTableName(self::TABLE_MEDIA_GALLERY_ASSET)) - ->where(self::MEDIA_GALLERY_ASSET_PATH . ' = ?', $path); - $data = $connection->query($select)->fetch(); - - if (empty($data)) { - $message = __('There is no such media asset with path "%1"', $path); - throw new NoSuchEntityException($message); - } - - return $this->mediaAssetFactory->create( - [ - 'id' => $data['id'], - 'path' => $data['path'], - 'title' => $data['title'], - 'description' => $data['description'], - 'source' => $data['source'], - 'hash' => $data['hash'], - 'contentType' => $data['content_type'], - 'width' => $data['width'], - 'height' => $data['height'], - 'size' => $data['size'], - 'createdAt' => $data['created_at'], - 'updatedAt' => $data['updated_at'], - ] - ); - } catch (\Exception $exception) { - $this->logger->critical($exception); - $message = __('An error occurred during get media asset list: %1', $exception->getMessage()); - throw new IntegrationException($message, $exception); - } - } -} diff --git a/app/code/Magento/MediaGallery/Model/Asset/Command/Save.php b/app/code/Magento/MediaGallery/Model/Asset/Command/Save.php deleted file mode 100644 index ba8497fe49205..0000000000000 --- a/app/code/Magento/MediaGallery/Model/Asset/Command/Save.php +++ /dev/null @@ -1,91 +0,0 @@ -resourceConnection = $resourceConnection; - $this->logger = $logger; - } - - /** - * Save media asset - * - * @param AssetInterface $mediaAsset - * - * @return int - * @throws CouldNotSaveException - */ - public function execute(AssetInterface $mediaAsset): int - { - try { - /** @var \Magento\Framework\DB\Adapter\Pdo\Mysql $connection */ - $connection = $this->resourceConnection->getConnection(); - $tableName = $this->resourceConnection->getTableName(self::TABLE_MEDIA_GALLERY_ASSET); - $record = [ - 'id' => $mediaAsset->getId(), - 'path' => $mediaAsset->getPath(), - 'title' => $mediaAsset->getTitle(), - 'source' => $mediaAsset->getSource(), - 'content_type' => $mediaAsset->getContentType(), - 'width' => $mediaAsset->getWidth(), - 'height' => $mediaAsset->getHeight(), - 'size' => $mediaAsset->getSize(), - ]; - - if ($mediaAsset->getCreatedAt()) { - $record['created_at'] = $mediaAsset->getCreatedAt(); - } - - if ($mediaAsset->getUpdatedAt()) { - $record['updated_at'] = $mediaAsset->getUpdatedAt(); - } - - $connection->insertOnDuplicate($tableName, $record); - return (int)$connection->lastInsertId($tableName); - } catch (\Exception $exception) { - $this->logger->critical($exception); - $message = __('An error occurred during media asset save: %1', $exception->getMessage()); - throw new CouldNotSaveException($message, $exception); - } - } -} diff --git a/app/code/Magento/MediaGallery/Model/Keyword/Command/GetAssetKeywords.php b/app/code/Magento/MediaGallery/Model/Keyword/Command/GetAssetKeywords.php deleted file mode 100644 index a37eaa8fc11fa..0000000000000 --- a/app/code/Magento/MediaGallery/Model/Keyword/Command/GetAssetKeywords.php +++ /dev/null @@ -1,95 +0,0 @@ -resourceConnection = $resourceConnection; - $this->assetKeywordFactory = $assetKeywordFactory; - $this->logger = $logger; - } - - /** - * Get asset related keywords. - * - * @param int $assetId - * - * @return KeywordInterface[] - * @throws IntegrationException - */ - public function execute(int $assetId): array - { - try { - $connection = $this->resourceConnection->getConnection(); - $tableAssetKeyword = $this->resourceConnection->getTableName(self::TABLE_ASSET_KEYWORD); - - $select = $connection->select() - ->from(['k' => $this->resourceConnection->getTableName(self::TABLE_KEYWORD)]) - ->join(['ak' => $tableAssetKeyword], 'k.id = ak.keyword_id') - ->where('ak.asset_id = ?', $assetId); - $data = $connection->query($select)->fetchAll(); - - $keywords = []; - foreach ($data as $keywordData) { - $keywords[] = $this->assetKeywordFactory->create( - [ - 'id' => $keywordData['id'], - 'keyword' => $keywordData['keyword'], - ] - ); - } - - return $keywords; - } catch (\Exception $exception) { - $this->logger->critical($exception); - $message = __('An error occurred during get asset keywords: %1', $exception->getMessage()); - throw new IntegrationException($message, $exception); - } - } -} diff --git a/app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetKeywords.php b/app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetKeywords.php deleted file mode 100644 index aa9f05af70b2f..0000000000000 --- a/app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetKeywords.php +++ /dev/null @@ -1,111 +0,0 @@ -resourceConnection = $resourceConnection; - $this->saveAssetLinks = $saveAssetLinks; - $this->logger = $logger; - } - - /** - * Save asset keywords. - * - * @param KeywordInterface[] $keywords - * @param int $assetId - * @throws CouldNotSaveException - */ - public function execute(array $keywords, int $assetId): void - { - try { - $data = []; - /** @var KeywordInterface $keyword */ - foreach ($keywords as $keyword) { - $data[] = $keyword->getKeyword(); - } - - if (!empty($data)) { - /** @var Mysql $connection */ - $connection = $this->resourceConnection->getConnection(); - $connection->insertArray( - $this->resourceConnection->getTableName(self::TABLE_KEYWORD), - [self::KEYWORD], - $data, - AdapterInterface::INSERT_IGNORE - ); - - $this->saveAssetLinks->execute($assetId, $this->getKeywordIds($data)); - } - } catch (\Exception $exception) { - $this->logger->critical($exception); - $message = __('An error occurred during save asset keyword: %1', $exception->getMessage()); - throw new CouldNotSaveException($message, $exception); - } - } - - /** - * Select keywords by names - * - * @param string[] $keywords - * - * @return int[] - */ - private function getKeywordIds(array $keywords): array - { - $connection = $this->resourceConnection->getConnection(); - $select = $connection->select() - ->from(['k' => $this->resourceConnection->getTableName(self::TABLE_KEYWORD)]) - ->columns(self::ID) - ->where('k.' . self::KEYWORD . ' in (?)', $keywords); - - return $connection->fetchCol($select); - } -} diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/DeleteByDirectoryPathTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/DeleteByDirectoryPathTest.php index a924aebf3ab05..70e0d2a96809c 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/DeleteByDirectoryPathTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/DeleteByDirectoryPathTest.php @@ -11,7 +11,7 @@ use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\Exception\CouldNotDeleteException; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\MediaGallery\Model\Asset\Command\DeleteByDirectoryPath; +use \Magento\MediaGallery\Model\ResourceModel\DeleteAssetsByPaths; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -30,7 +30,7 @@ class DeleteByDirectoryPathTest extends TestCase private $resourceConnection; /** - * @var DeleteByDirectoryPath + * @var DeleteAssetsByPaths */ private $deleteMediaAssetByDirectoryPath; @@ -53,7 +53,7 @@ protected function setUp(): void $this->resourceConnection = $this->createMock(ResourceConnection::class); $this->deleteMediaAssetByDirectoryPath = (new ObjectManager($this))->getObject( - DeleteByDirectoryPath::class, + DeleteAssetsByPaths::class, [ 'resourceConnection' => $this->resourceConnection, 'logger' => $this->logger, diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/DeleteByPathTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/DeleteByPathTest.php index e8bbbc1f64dce..1262eeebae460 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/DeleteByPathTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/DeleteByPathTest.php @@ -11,7 +11,7 @@ use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\Exception\CouldNotDeleteException; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\MediaGallery\Model\Asset\Command\DeleteByPath; +use Magento\MediaGallery\Model\ResourceModel\DeleteAssetsByPaths as DeleteByPath; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -74,7 +74,7 @@ public function testSuccessfulDeleteByIdExecution(): void ->method('delete') ->with('prefix_' . self::TABLE_NAME, ['path = ?' => self::FILE_PATH]); - $this->deleteMediaAssetByPath->execute(self::FILE_PATH); + $this->deleteMediaAssetByPath->execute([self::FILE_PATH]); } /** @@ -91,6 +91,6 @@ public function testExceptionOnDeleteExecution(): void $this->logger->expects($this->once()) ->method('critical') ->willReturnSelf(); - $this->deleteMediaAssetByPath->execute(self::FILE_PATH); + $this->deleteMediaAssetByPath->execute([self::FILE_PATH]); } } diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionDuringMediaAssetInitializationTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionDuringMediaAssetInitializationTest.php index 5f99163db8f12..ff211921f89a2 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionDuringMediaAssetInitializationTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionDuringMediaAssetInitializationTest.php @@ -12,7 +12,7 @@ use Magento\Framework\DB\Select; use Magento\Framework\Exception\IntegrationException; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\MediaGallery\Model\Asset\Command\GetById; +use Magento\MediaGallery\Model\ResourceModel\GetAssetsByIds as GetById; use Magento\MediaGalleryApi\Api\Data\AssetInterfaceFactory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -109,6 +109,6 @@ public function testErrorDuringMediaAssetInitializationException(): void ->method('critical') ->willReturnSelf(); - $this->getMediaAssetById->execute(self::MEDIA_ASSET_STUB_ID); + $this->getMediaAssetById->execute([self::MEDIA_ASSET_STUB_ID]); } } diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionNoSuchEntityTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionNoSuchEntityTest.php index 8ece8408aa44e..d989792c68e9c 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionNoSuchEntityTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionNoSuchEntityTest.php @@ -13,7 +13,7 @@ use Magento\Framework\DB\Select; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\MediaGallery\Model\Asset\Command\GetById; +use Magento\MediaGallery\Model\ResourceModel\GetAssetsByIds as GetById; use Magento\MediaGalleryApi\Api\Data\AssetInterfaceFactory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -89,6 +89,6 @@ public function testNotFoundMediaAssetException(): void $this->expectException(NoSuchEntityException::class); - $this->getMediaAssetById->execute(self::MEDIA_ASSET_STUB_ID); + $this->getMediaAssetById->execute([self::MEDIA_ASSET_STUB_ID]); } } diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionOnGetDataTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionOnGetDataTest.php index 3b47b0036224b..032326ad072f5 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionOnGetDataTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionOnGetDataTest.php @@ -13,7 +13,7 @@ use Magento\Framework\DB\Select; use Magento\Framework\Exception\IntegrationException; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\MediaGallery\Model\Asset\Command\GetById; +use Magento\MediaGallery\Model\ResourceModel\GetAssetsByIds as GetById; use Magento\MediaGalleryApi\Api\Data\AssetInterfaceFactory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -105,6 +105,6 @@ public function testExceptionDuringGetMediaAssetData(): void ->method('critical') ->willReturnSelf(); - $this->getMediaAssetById->execute(self::MEDIA_ASSET_STUB_ID); + $this->getMediaAssetById->execute([self::MEDIA_ASSET_STUB_ID]); } } diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdSuccessfulTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdSuccessfulTest.php index 2c24899746473..176ebf2474f52 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdSuccessfulTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdSuccessfulTest.php @@ -12,7 +12,7 @@ use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Select; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\MediaGallery\Model\Asset\Command\GetById; +use Magento\MediaGallery\Model\ResourceModel\GetAssetsByIds as GetById; use Magento\MediaGalleryApi\Api\Data\AssetInterface; use Magento\MediaGalleryApi\Api\Data\AssetInterfaceFactory; use PHPUnit\Framework\MockObject\MockObject; @@ -107,7 +107,7 @@ public function testSuccessfulGetByIdExecution(): void $this->assertEquals( $mediaAssetStub, - $this->getMediaAssetById->execute(self::MEDIA_ASSET_STUB_ID) + $this->getMediaAssetById->execute([self::MEDIA_ASSET_STUB_ID]) ); } } diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/SaveTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/SaveTest.php index 2693da5f0da84..20fccf7c4a221 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/SaveTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/SaveTest.php @@ -13,7 +13,7 @@ use Magento\Framework\Exception\CouldNotSaveException; use Magento\Framework\Reflection\DataObjectProcessor; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\MediaGallery\Model\Asset\Command\Save; +use Magento\MediaGallery\Model\ResourceModel\SaveAssets as Save; use Magento\MediaGalleryApi\Api\Data\AssetInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -150,7 +150,7 @@ public function testSuccessfulExecute(): void ->with(self::PREFIXED_TABLE_MEDIA_GALLERY_ASSET) ->willReturn(self::INSERT_ID); - $this->save->execute($this->mediaAssetMock); + $this->save->execute([$this->mediaAssetMock]); } /** @@ -185,6 +185,6 @@ public function testExceptionExecute(): void $this->expectException(CouldNotSaveException::class); - $this->save->execute($this->mediaAssetMock); + $this->save->execute([$this->mediaAssetMock]); } } diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php index 1bb0e634b9a1a..48165fb7de537 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php @@ -11,7 +11,7 @@ use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Select; use Magento\Framework\Exception\IntegrationException; -use Magento\MediaGallery\Model\Keyword\Command\GetAssetKeywords; +use Magento\MediaGallery\Model\ResourceModel\Keyword\GetAssetsKeywords as GetAssetKeywords; use Magento\MediaGalleryApi\Api\Data\KeywordInterface; use Magento\MediaGalleryApi\Api\Data\KeywordInterfaceFactory; use PHPUnit\Framework\MockObject\MockObject; @@ -67,7 +67,7 @@ public function testFind(array $databaseQueryResult, int $expectedNumberOfFoundK $this->configureAssetKeywordFactoryStub(); /** @var KeywordInterface[] $keywords */ - $keywords = $this->sut->execute($randomAssetId); + $keywords = $this->sut->execute([$randomAssetId]); $this->assertCount($expectedNumberOfFoundKeywords, $keywords); } @@ -113,7 +113,7 @@ public function testNotFoundBecauseOfError(): void ->method('critical') ->willReturnSelf(); - $this->sut->execute($randomAssetId); + $this->sut->execute([$randomAssetId]); } /** diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetKeywordsTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetKeywordsTest.php index f323d4c1fe2a2..3b1bc5a4a8c74 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetKeywordsTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetKeywordsTest.php @@ -12,7 +12,7 @@ use Magento\Framework\DB\Adapter\Pdo\Mysql; use Magento\Framework\DB\Select; use Magento\Framework\Exception\CouldNotSaveException; -use Magento\MediaGallery\Model\Keyword\Command\SaveAssetKeywords; +use Magento\MediaGallery\Model\ResourceModel\Keyword\SaveAssetsKeywords as SaveAssetKeywords; use Magento\MediaGallery\Model\ResourceModel\Keyword\SaveAssetLinks; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -95,7 +95,7 @@ public function testAssetKeywordsSave(array $keywords, int $assetId, array $item ); } - $this->sut->execute($keywords, $assetId); + $this->sut->execute($keywords); } /** @@ -115,7 +115,7 @@ public function testAssetNotSavingCausedByError(): void ->method('critical') ->willReturnSelf(); - $this->sut->execute([$keyword], 1); + $this->sut->execute([$keyword]); } /** diff --git a/app/code/Magento/MediaGallery/etc/di.xml b/app/code/Magento/MediaGallery/etc/di.xml index b040bf9b35da3..25d9434f4fbbc 100644 --- a/app/code/Magento/MediaGallery/etc/di.xml +++ b/app/code/Magento/MediaGallery/etc/di.xml @@ -9,14 +9,6 @@ - - - - - - - - diff --git a/app/code/Magento/MediaGalleryApi/Model/Asset/Command/DeleteByDirectoryPathInterface.php b/app/code/Magento/MediaGalleryApi/Model/Asset/Command/DeleteByDirectoryPathInterface.php deleted file mode 100644 index 1ed46566cfb21..0000000000000 --- a/app/code/Magento/MediaGalleryApi/Model/Asset/Command/DeleteByDirectoryPathInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -product.info.addtocart.payflowbml - + Magento\Paypal\Model\PayflowConfig - + Magento\Paypal\Model\Config diff --git a/app/code/Magento/Search/Model/QueryFactory.php b/app/code/Magento/Search/Model/QueryFactory.php index 4186b5c3055f4..cc97806f31f07 100644 --- a/app/code/Magento/Search/Model/QueryFactory.php +++ b/app/code/Magento/Search/Model/QueryFactory.php @@ -17,7 +17,7 @@ * @api * @since 100.0.2 */ -class QueryFactory implements QueryFactoryInterface +class QueryFactory { /** * Query variable diff --git a/app/code/Magento/Search/Model/QueryFactoryInterface.php b/app/code/Magento/Search/Model/QueryFactoryInterface.php deleted file mode 100644 index 7da1fb4acb002..0000000000000 --- a/app/code/Magento/Search/Model/QueryFactoryInterface.php +++ /dev/null @@ -1,18 +0,0 @@ - - + diff --git a/app/code/Magento/Store/Controller/Store/Redirect.php b/app/code/Magento/Store/Controller/Store/Redirect.php index c20e3b31e09b1..31f945ca4dd42 100644 --- a/app/code/Magento/Store/Controller/Store/Redirect.php +++ b/app/code/Magento/Store/Controller/Store/Redirect.php @@ -17,7 +17,7 @@ use Magento\Framework\Session\Generic; use Magento\Framework\Session\SidResolverInterface; use Magento\Store\Api\StoreRepositoryInterface; -use Magento\Store\Api\StoreResolverInterface; +use Magento\Store\Model\StoreResolver as StoreResolverInterface; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use Magento\Store\Model\StoreResolver; diff --git a/app/code/Magento/Store/Model/StoreManager.php b/app/code/Magento/Store/Model/StoreManager.php index c3137150c8081..47d15adf69ea3 100644 --- a/app/code/Magento/Store/Model/StoreManager.php +++ b/app/code/Magento/Store/Model/StoreManager.php @@ -7,7 +7,7 @@ use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Store\Api\StoreResolverInterface; +use Magento\Store\Model\StoreResolver as StoreResolverInterface; use Magento\Store\Model\ResourceModel\StoreWebsiteRelation; /** diff --git a/app/code/Magento/Store/Model/StoreResolver.php b/app/code/Magento/Store/Model/StoreResolver.php index 2a950b699abe7..ae575b65320f9 100644 --- a/app/code/Magento/Store/Model/StoreResolver.php +++ b/app/code/Magento/Store/Model/StoreResolver.php @@ -10,7 +10,7 @@ /** * Class used to resolve store from url path or get parameters or cookie. */ -class StoreResolver implements \Magento\Store\Api\StoreResolverInterface +class StoreResolver { /** * Cache tag diff --git a/app/code/Magento/Store/Model/StoreSwitcher/CleanTargetUrl.php b/app/code/Magento/Store/Model/StoreSwitcher/CleanTargetUrl.php index c907ab14c0137..ab20c12f6e0a9 100644 --- a/app/code/Magento/Store/Model/StoreSwitcher/CleanTargetUrl.php +++ b/app/code/Magento/Store/Model/StoreSwitcher/CleanTargetUrl.php @@ -8,7 +8,7 @@ namespace Magento\Store\Model\StoreSwitcher; use Magento\Store\Api\Data\StoreInterface; -use Magento\Store\Api\StoreResolverInterface; +use Magento\Store\Model\StoreManagerInterface; use Magento\Store\Model\StoreSwitcherInterface; use Magento\Framework\Url\Helper\Data as UrlHelper; diff --git a/app/code/Magento/Store/Test/Unit/Controller/Store/RedirectTest.php b/app/code/Magento/Store/Test/Unit/Controller/Store/RedirectTest.php index 7d873ee6c1d8e..b57decb135cc9 100755 --- a/app/code/Magento/Store/Test/Unit/Controller/Store/RedirectTest.php +++ b/app/code/Magento/Store/Test/Unit/Controller/Store/RedirectTest.php @@ -17,7 +17,7 @@ use Magento\Framework\Session\SidResolverInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\Store\Api\StoreRepositoryInterface; -use Magento\Store\Api\StoreResolverInterface; +use Magento\Store\Model\StoreResolver as StoreResolverInterface; use Magento\Store\Controller\Store\Redirect; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; diff --git a/app/code/Magento/Store/Test/Unit/Model/StoreManagerTest.php b/app/code/Magento/Store/Test/Unit/Model/StoreManagerTest.php index 4d95135a07d91..3d759767857f0 100644 --- a/app/code/Magento/Store/Test/Unit/Model/StoreManagerTest.php +++ b/app/code/Magento/Store/Test/Unit/Model/StoreManagerTest.php @@ -10,7 +10,7 @@ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Store\Api\Data\StoreInterface; use Magento\Store\Api\StoreRepositoryInterface; -use Magento\Store\Api\StoreResolverInterface; +use Magento\Store\Model\StoreResolver as StoreResolverInterface; use Magento\Store\Model\StoreManager; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; diff --git a/app/code/Magento/Store/etc/di.xml b/app/code/Magento/Store/etc/di.xml index ccfec562ba103..1dba7a635febc 100644 --- a/app/code/Magento/Store/etc/di.xml +++ b/app/code/Magento/Store/etc/di.xml @@ -13,7 +13,6 @@ - diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php index cc8a60cf0937a..8758daebd6d36 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php @@ -11,7 +11,7 @@ use Magento\Store\Api\Data\StoreConfigInterface; use Magento\Store\Api\StoreConfigManagerInterface; use Magento\Store\Api\StoreRepositoryInterface; -use Magento\Store\Api\StoreResolverInterface; +use Magento\Store\Model\StoreResolver as StoreResolverInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\GraphQlAbstract; diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/PayflowproVoidTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/PayflowproVoidTest.php index dc1c97e593fae..b745ad0cd16b3 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/PayflowproVoidTest.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/PayflowproVoidTest.php @@ -20,7 +20,7 @@ use Magento\Payment\Gateway\Command\CommandException; use Magento\Payment\Helper\Data; use Magento\Payment\Model\InfoInterface; -use Magento\Payment\Model\Method\ConfigInterfaceFactory; +use Magento\Payment\Gateway\ConfigInterfaceFactory as ConfigInterfaceFactory; use Magento\Payment\Model\Method\Logger; use Magento\Paypal\Model\Payflow\Service\Gateway; use Magento\Paypal\Model\Payflow\Service\Response\Handler\HandlerInterface; diff --git a/dev/tests/integration/testsuite/Magento/Store/Controller/Store/SwitchActionTest.php b/dev/tests/integration/testsuite/Magento/Store/Controller/Store/SwitchActionTest.php index c506b77e45442..000587ceb63b3 100644 --- a/dev/tests/integration/testsuite/Magento/Store/Controller/Store/SwitchActionTest.php +++ b/dev/tests/integration/testsuite/Magento/Store/Controller/Store/SwitchActionTest.php @@ -13,7 +13,7 @@ use Magento\Framework\App\Response\RedirectInterface; use Magento\Framework\Encryption\UrlCoder; use Magento\Framework\Interception\InterceptorInterface; -use Magento\Store\Api\StoreResolverInterface; +use Magento\Store\Model\StoreManagerInterface as StoreResolverInterface; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use Magento\Store\Model\StoreSwitcher\ContextInterface;