diff --git a/AdobeStockImageAdminUi/etc/config.xml b/AdobeStockImageAdminUi/etc/config.xml deleted file mode 100644 index fe8e73c406e5..000000000000 --- a/AdobeStockImageAdminUi/etc/config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - 0 - - - - diff --git a/MediaContentSynchronization/Model/Consume.php b/MediaContentSynchronization/Model/Consumer.php similarity index 97% rename from MediaContentSynchronization/Model/Consume.php rename to MediaContentSynchronization/Model/Consumer.php index bcce3514e4ad..b17d1dea2301 100644 --- a/MediaContentSynchronization/Model/Consume.php +++ b/MediaContentSynchronization/Model/Consumer.php @@ -12,7 +12,7 @@ /** * Media content synchronization queue consumer. */ -class Consume +class Consumer { /** * @var SynchronizeInterface diff --git a/MediaContentSynchronization/Plugin/SynchronizeMediaContent.php b/MediaContentSynchronization/Plugin/SynchronizeMediaContent.php index 891264932b58..dcd8a1059dd9 100644 --- a/MediaContentSynchronization/Plugin/SynchronizeMediaContent.php +++ b/MediaContentSynchronization/Plugin/SynchronizeMediaContent.php @@ -9,7 +9,7 @@ use Magento\MediaContentSynchronization\Model\Publish; use Magento\Framework\Exception\LocalizedException; -use Magento\MediaGallerySynchronization\Model\Consume; +use Magento\MediaGallerySynchronization\Model\Consumer; /** * Run media content synchronization after the media files consumer finish files synchronization. @@ -32,10 +32,10 @@ public function __construct(Publish $publish) /** * Publish content synchronization request message to the queue. * - * @param Consume $subject + * @param Consumer $subject * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterExecute(Consume $subject): void + public function afterExecute(Consumer $subject): void { $this->publish->execute(); } diff --git a/MediaContentSynchronization/etc/communication.xml b/MediaContentSynchronization/etc/communication.xml index e3436aee8533..0318f8049f61 100644 --- a/MediaContentSynchronization/etc/communication.xml +++ b/MediaContentSynchronization/etc/communication.xml @@ -9,6 +9,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:Communication/etc/communication.xsd"> + type="Magento\MediaContentSynchronization\Model\Consumer" method="execute"/> diff --git a/MediaContentSynchronization/etc/di.xml b/MediaContentSynchronization/etc/di.xml index d4615c15206e..9529eabd8712 100644 --- a/MediaContentSynchronization/etc/di.xml +++ b/MediaContentSynchronization/etc/di.xml @@ -14,7 +14,7 @@ - + diff --git a/MediaContentSynchronization/etc/queue_consumer.xml b/MediaContentSynchronization/etc/queue_consumer.xml index 6a141c04c59a..d224bbc64d73 100644 --- a/MediaContentSynchronization/etc/queue_consumer.xml +++ b/MediaContentSynchronization/etc/queue_consumer.xml @@ -7,5 +7,5 @@ --> + connection="db" handler="Magento\MediaContentSynchronization\Model\Consumer::execute"/> diff --git a/MediaGalleryMetadataApi/Api/ExtractMetadataInterface.php b/MediaGalleryMetadataApi/Api/ExtractMetadataInterface.php index dd7848caa48e..2327406db8be 100644 --- a/MediaGalleryMetadataApi/Api/ExtractMetadataInterface.php +++ b/MediaGalleryMetadataApi/Api/ExtractMetadataInterface.php @@ -8,7 +8,6 @@ namespace Magento\MediaGalleryMetadataApi\Api; -use Magento\Framework\Exception\LocalizedException; use Magento\MediaGalleryMetadataApi\Api\Data\MetadataInterface; /** diff --git a/MediaGalleryMetadataApi/Model/AddMetadataComposite.php b/MediaGalleryMetadataApi/Model/AddMetadataComposite.php index 507d86e6b890..d18109e40438 100644 --- a/MediaGalleryMetadataApi/Model/AddMetadataComposite.php +++ b/MediaGalleryMetadataApi/Model/AddMetadataComposite.php @@ -14,7 +14,7 @@ /** * Metadata writer pool */ -class AddMetadataComposite +class AddMetadataComposite implements AddMetadataInterface { /** * @var AddMetadataInterface[] diff --git a/MediaGalleryRenditions/Model/Config.php b/MediaGalleryRenditions/Model/Config.php index 6cec41ab0289..bde71450dbcd 100644 --- a/MediaGalleryRenditions/Model/Config.php +++ b/MediaGalleryRenditions/Model/Config.php @@ -8,7 +8,7 @@ namespace Magento\MediaGalleryRenditions\Model; -use Magento\MediaGalleryRenditionsApi\Model\ConfigInterface; +use Magento\MediaGalleryRenditionsApi\Api\ConfigInterface; use Magento\Framework\App\Config\ScopeConfigInterface; /** diff --git a/MediaGalleryRenditionsApi/Model/ConfigInterface.php b/MediaGalleryRenditionsApi/Api/ConfigInterface.php similarity index 91% rename from MediaGalleryRenditionsApi/Model/ConfigInterface.php rename to MediaGalleryRenditionsApi/Api/ConfigInterface.php index 373233a21fc2..758cc66c2864 100644 --- a/MediaGalleryRenditionsApi/Model/ConfigInterface.php +++ b/MediaGalleryRenditionsApi/Api/ConfigInterface.php @@ -6,7 +6,7 @@ declare(strict_types=1); -namespace Magento\MediaGalleryRenditionsApi\Model; +namespace Magento\MediaGalleryRenditionsApi\Api; /** * Class responsible for providing API access to Media Gallery Renditions system configuration diff --git a/MediaGallerySynchronization/Model/Consume.php b/MediaGallerySynchronization/Model/Consumer.php similarity index 97% rename from MediaGallerySynchronization/Model/Consume.php rename to MediaGallerySynchronization/Model/Consumer.php index 79c0c9a1a803..0c5f49733f6d 100644 --- a/MediaGallerySynchronization/Model/Consume.php +++ b/MediaGallerySynchronization/Model/Consumer.php @@ -12,7 +12,7 @@ /** * Media gallery image synchronization queue consumer. */ -class Consume +class Consumer { /** * @var SynchronizeInterface diff --git a/MediaGallerySynchronization/etc/communication.xml b/MediaGallerySynchronization/etc/communication.xml index ba5ae5fc9f9b..37afb732d04b 100644 --- a/MediaGallerySynchronization/etc/communication.xml +++ b/MediaGallerySynchronization/etc/communication.xml @@ -9,6 +9,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:Communication/etc/communication.xsd"> + type="Magento\MediaGallerySynchronization\Model\Consumer" method="execute"/> diff --git a/MediaGallerySynchronization/etc/queue_consumer.xml b/MediaGallerySynchronization/etc/queue_consumer.xml index 4471d68fd8c4..0d78303ffde1 100644 --- a/MediaGallerySynchronization/etc/queue_consumer.xml +++ b/MediaGallerySynchronization/etc/queue_consumer.xml @@ -7,5 +7,5 @@ --> + connection="db" handler="Magento\MediaGallerySynchronization\Model\Consumer::execute"/> diff --git a/MediaGallerySynchronizationApi/Model/FetchBatchesInterface.php b/MediaGallerySynchronizationApi/Model/FetchBatchesInterface.php index c5ce10caa2c4..e460558467ac 100644 --- a/MediaGallerySynchronizationApi/Model/FetchBatchesInterface.php +++ b/MediaGallerySynchronizationApi/Model/FetchBatchesInterface.php @@ -7,8 +7,6 @@ namespace Magento\MediaGallerySynchronizationApi\Model; -use Magento\Framework\Exception\LocalizedException; - /** * Fetch data from database in batches */ diff --git a/MediaGalleryUi/Controller/Adminhtml/Image/Delete.php b/MediaGalleryUi/Controller/Adminhtml/Image/Delete.php index edc190e9c45e..7626ade43e01 100644 --- a/MediaGalleryUi/Controller/Adminhtml/Image/Delete.php +++ b/MediaGalleryUi/Controller/Adminhtml/Image/Delete.php @@ -102,17 +102,14 @@ public function execute() $assets = $this->getAssetsByIds->execute($imageIds); $this->deleteImage->execute($assets); $responseCode = self::HTTP_OK; - $message = count($imageIds) > 1 ? - 'assets have been' : - ' asset "' . current($assets)->getTitle() . '" has been'; + if (count($imageIds) === 1) { + $message = sprintf('The asset %s has been successfully deleted', current($assets)->getTitle()); + } else { + $message = 'Assets have been successfully deleted'; + } $responseContent = [ 'success' => true, - 'message' => __( - 'The %message successfully deleted', - [ - 'message' => $message - ] - ), + 'message' => __($message), ]; } catch (LocalizedException $exception) { $responseCode = self::HTTP_BAD_REQUEST; diff --git a/MediaGalleryUi/Model/AssetDetailsProvider/CreatedAt.php b/MediaGalleryUi/Model/AssetDetailsProvider/CreatedAt.php index ca8c5e32cc7b..198354209bc2 100644 --- a/MediaGalleryUi/Model/AssetDetailsProvider/CreatedAt.php +++ b/MediaGalleryUi/Model/AssetDetailsProvider/CreatedAt.php @@ -7,8 +7,6 @@ namespace Magento\MediaGalleryUi\Model\AssetDetailsProvider; -use Magento\Framework\Exception\IntegrationException; -use Magento\MediaContentApi\Api\GetContentByAssetIdsInterface; use Magento\MediaGalleryApi\Api\Data\AssetInterface; use Magento\MediaGalleryUi\Model\AssetDetailsProviderInterface; diff --git a/MediaGalleryUi/Model/AssetDetailsProvider/Height.php b/MediaGalleryUi/Model/AssetDetailsProvider/Height.php index c50799ff27ee..b2b0f389f6b9 100644 --- a/MediaGalleryUi/Model/AssetDetailsProvider/Height.php +++ b/MediaGalleryUi/Model/AssetDetailsProvider/Height.php @@ -8,7 +8,6 @@ namespace Magento\MediaGalleryUi\Model\AssetDetailsProvider; use Magento\Framework\Exception\IntegrationException; -use Magento\MediaContentApi\Api\GetContentByAssetIdsInterface; use Magento\MediaGalleryApi\Api\Data\AssetInterface; use Magento\MediaGalleryUi\Model\AssetDetailsProviderInterface; diff --git a/MediaGalleryUi/Model/AssetDetailsProvider/Size.php b/MediaGalleryUi/Model/AssetDetailsProvider/Size.php index e8488d5e392c..55841cc5abd3 100644 --- a/MediaGalleryUi/Model/AssetDetailsProvider/Size.php +++ b/MediaGalleryUi/Model/AssetDetailsProvider/Size.php @@ -8,7 +8,6 @@ namespace Magento\MediaGalleryUi\Model\AssetDetailsProvider; use Magento\Framework\Exception\IntegrationException; -use Magento\MediaContentApi\Api\GetContentByAssetIdsInterface; use Magento\MediaGalleryApi\Api\Data\AssetInterface; use Magento\MediaGalleryUi\Model\AssetDetailsProviderInterface; diff --git a/MediaGalleryUi/Model/AssetDetailsProvider/Type.php b/MediaGalleryUi/Model/AssetDetailsProvider/Type.php index 9197d94df3b1..5b47616398ef 100644 --- a/MediaGalleryUi/Model/AssetDetailsProvider/Type.php +++ b/MediaGalleryUi/Model/AssetDetailsProvider/Type.php @@ -8,7 +8,6 @@ namespace Magento\MediaGalleryUi\Model\AssetDetailsProvider; use Magento\Framework\Exception\IntegrationException; -use Magento\MediaContentApi\Api\GetContentByAssetIdsInterface; use Magento\MediaGalleryApi\Api\Data\AssetInterface; use Magento\MediaGalleryUi\Model\AssetDetailsProviderInterface; diff --git a/MediaGalleryUi/Model/AssetDetailsProvider/UpdatedAt.php b/MediaGalleryUi/Model/AssetDetailsProvider/UpdatedAt.php index 9ce30d17ba77..89cb1c8df826 100644 --- a/MediaGalleryUi/Model/AssetDetailsProvider/UpdatedAt.php +++ b/MediaGalleryUi/Model/AssetDetailsProvider/UpdatedAt.php @@ -7,8 +7,6 @@ namespace Magento\MediaGalleryUi\Model\AssetDetailsProvider; -use Magento\Framework\Exception\IntegrationException; -use Magento\MediaContentApi\Api\GetContentByAssetIdsInterface; use Magento\MediaGalleryApi\Api\Data\AssetInterface; use Magento\MediaGalleryUi\Model\AssetDetailsProviderInterface; diff --git a/MediaGalleryUi/Model/AssetDetailsProvider/UsedIn.php b/MediaGalleryUi/Model/AssetDetailsProvider/UsedIn.php index 83cabd644376..8ab951ce917d 100644 --- a/MediaGalleryUi/Model/AssetDetailsProvider/UsedIn.php +++ b/MediaGalleryUi/Model/AssetDetailsProvider/UsedIn.php @@ -71,15 +71,11 @@ private function getUsedIn(int $assetId): array foreach ($contentIdentities as $contentIdentity) { $entityId = $contentIdentity->getEntityId(); $type = $this->contentTypes[$contentIdentity->getEntityType()] ?? $contentIdentity->getEntityType(); - + if (!isset($entityIds[$type])) { $usedIn[$type] = 1; } elseif ($entityIds[$type]['entity_id'] !== $entityId) { - if (isset($usedIn[$type])) { - $usedIn[$type] +=1; - } else { - $usedIn[$type] = $usedIn[$type]+1; - } + ++$usedIn[$type]; } $entityIds[$type]['entity_id'] = $entityId; } diff --git a/MediaGalleryUi/Model/AssetDetailsProvider/Width.php b/MediaGalleryUi/Model/AssetDetailsProvider/Width.php index 7cb7392ab11f..64e9cf8ad1a8 100644 --- a/MediaGalleryUi/Model/AssetDetailsProvider/Width.php +++ b/MediaGalleryUi/Model/AssetDetailsProvider/Width.php @@ -8,7 +8,6 @@ namespace Magento\MediaGalleryUi\Model\AssetDetailsProvider; use Magento\Framework\Exception\IntegrationException; -use Magento\MediaContentApi\Api\GetContentByAssetIdsInterface; use Magento\MediaGalleryApi\Api\Data\AssetInterface; use Magento\MediaGalleryUi\Model\AssetDetailsProviderInterface; diff --git a/MediaGalleryUi/Model/DeleteImage.php b/MediaGalleryUi/Model/DeleteImage.php index 9b00a1dbe315..2f4793c28ad4 100644 --- a/MediaGalleryUi/Model/DeleteImage.php +++ b/MediaGalleryUi/Model/DeleteImage.php @@ -52,11 +52,10 @@ public function __construct( } /** - * Delete asset image physically from file storage and from data storage via MediaGallery plugin. - * - * @see \Magento\MediaGallery\Plugin\Wysiwyg\Images\Storage + * Delete asset image physically from file storage and from data storage. * * @param AssetInterface[] $assets + * @throws LocalizedException */ public function execute(array $assets): void { diff --git a/MediaGalleryUi/Model/Listing/DataProvider.php b/MediaGalleryUi/Model/Listing/DataProvider.php index e8d3c80866c7..88401465d56b 100644 --- a/MediaGalleryUi/Model/Listing/DataProvider.php +++ b/MediaGalleryUi/Model/Listing/DataProvider.php @@ -15,7 +15,6 @@ use Magento\Framework\App\RequestInterface; use Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory; use Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider as UiComponentDataProvider; -use Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult; use Magento\MediaGalleryUi\Ui\Component\Listing\Provider; /** diff --git a/MediaGalleryUi/Plugin/ResizeSyncedFiles.php b/MediaGalleryUi/Plugin/ResizeSyncedFiles.php index 93e426eb33ce..5180df755bd4 100644 --- a/MediaGalleryUi/Plugin/ResizeSyncedFiles.php +++ b/MediaGalleryUi/Plugin/ResizeSyncedFiles.php @@ -10,6 +10,9 @@ use Magento\MediaGallerySynchronization\Model\SynchronizeFiles; use Magento\Cms\Model\Wysiwyg\Images\Storage; +/** + * Create resizes files that were synced + */ class ResizeSyncedFiles { /** diff --git a/MediaGalleryUi/Ui/Component/ImageUploaderStandAlone.php b/MediaGalleryUi/Ui/Component/ImageUploaderStandAlone.php index 3052c9f8eb22..1fc5a80960a6 100644 --- a/MediaGalleryUi/Ui/Component/ImageUploaderStandAlone.php +++ b/MediaGalleryUi/Ui/Component/ImageUploaderStandAlone.php @@ -24,9 +24,10 @@ public function prepare(): void array_replace_recursive( (array) $this->getData('config'), [ - // phpcs:disable Magento2.Files.LineLength, Generic.Files.LineLength - 'actionsPath' => 'standalone_media_gallery_listing.standalone_media_gallery_listing.media_gallery_columns.thumbnail_url', - 'directoriesPath' => 'standalone_media_gallery_listing.standalone_media_gallery_listing.media_gallery_directories', + 'actionsPath' => 'standalone_media_gallery_listing.standalone_media_gallery_listing' . + '.media_gallery_columns.thumbnail_url', + 'directoriesPath' => 'standalone_media_gallery_listing.standalone_media_gallery_listing' . + '.media_gallery_directories', 'messagesPath' => 'standalone_media_gallery_listing.standalone_media_gallery_listing.messages' ] ) diff --git a/MediaGalleryUi/Ui/Component/Listing/Columns/Url.php b/MediaGalleryUi/Ui/Component/Listing/Columns/Url.php index 7aea096f2315..b6fc08de137c 100644 --- a/MediaGalleryUi/Ui/Component/Listing/Columns/Url.php +++ b/MediaGalleryUi/Ui/Component/Listing/Columns/Url.php @@ -11,7 +11,6 @@ use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\View\Element\UiComponent\ContextInterface; use Magento\Framework\View\Element\UiComponentFactory; -use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use Magento\Ui\Component\Listing\Columns\Column; use Magento\Cms\Helper\Wysiwyg\Images; diff --git a/MediaGalleryUi/Ui/Component/Listing/Provider.php b/MediaGalleryUi/Ui/Component/Listing/Provider.php index d1ba5bb67282..160097967165 100644 --- a/MediaGalleryUi/Ui/Component/Listing/Provider.php +++ b/MediaGalleryUi/Ui/Component/Listing/Provider.php @@ -81,7 +81,7 @@ public function getData() $data[$key]['content_type'] = strtoupper(str_replace('image/', '', $asset['content_type'])); $data[$key]['preview_url'] = $asset['path']; $data[$key]['keywords'] = isset($keywords[$asset['id']]) ? implode(",", $keywords[$asset['id']]) : ''; - $data[$key]['source'] = empty($asset['source']) ? 'Local' : $asset['source']; + $data[$key]['source'] = empty($asset['source']) ? __('Local') : $asset['source']; } return $data; } diff --git a/MediaGalleryUi/etc/config.xml b/MediaGalleryUi/etc/config.xml index 593b1b8e58fd..fe8e73c406e5 100644 --- a/MediaGalleryUi/etc/config.xml +++ b/MediaGalleryUi/etc/config.xml @@ -9,7 +9,7 @@ - 1 + 0 diff --git a/MediaGalleryUiApi/Api/ConfigInterface.php b/MediaGalleryUiApi/Api/ConfigInterface.php index 9246c52cdd01..a516ac927fd2 100644 --- a/MediaGalleryUiApi/Api/ConfigInterface.php +++ b/MediaGalleryUiApi/Api/ConfigInterface.php @@ -14,7 +14,7 @@ interface ConfigInterface { /** - * Check if masonry grid UI is enabled for Magento media gallery + * Check if grid UI is enabled for Magento media gallery * * @return bool */