Skip to content

Commit 801b4b3

Browse files
committed
Cleanup.
1 parent 38d1556 commit 801b4b3

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

app/code/Magento/MediaStorage/Service/ImageResize.php

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@
1515
use Magento\Framework\App\ObjectManager;
1616
use Magento\Framework\Exception\NotFoundException;
1717
use Magento\Framework\Filesystem;
18+
use Magento\Framework\Filesystem\Directory\WriteInterface;
1819
use Magento\Framework\Image;
1920
use Magento\Framework\Image\Factory as ImageFactory;
2021
use Magento\Catalog\Model\Product\Media\ConfigInterface as MediaConfig;
2122
use Magento\Framework\App\State;
2223
use Magento\Framework\View\ConfigInterface as ViewConfig;
23-
use \Magento\Catalog\Model\ResourceModel\Product\Image as ProductImage;
24+
use Magento\Catalog\Model\ResourceModel\Product\Image as ProductImage;
2425
use Magento\Store\Model\StoreManagerInterface;
2526
use Magento\Theme\Model\Config\Customization as ThemeCustomizationConfig;
26-
use Magento\Theme\Model\ResourceModel\Theme\Collection;
27+
use Magento\Theme\Model\ResourceModel\Theme\Collection as ThemeCollection;
2728
use Magento\Framework\App\Filesystem\DirectoryList;
28-
use Magento\MediaStorage\Helper\File\Storage\Database;
29+
use Magento\MediaStorage\Helper\File\Storage\Database as FileStorageDatabase;
2930
use Magento\Theme\Model\Theme;
3031

3132
/**
@@ -76,24 +77,20 @@ class ImageResize
7677
private $themeCustomizationConfig;
7778

7879
/**
79-
* @var Collection
80+
* @var ThemeCollection
8081
*/
8182
private $themeCollection;
8283

8384
/**
84-
* @var Filesystem
85+
* @var WriteInterface
8586
*/
8687
private $mediaDirectory;
8788

8889
/**
89-
* @var Filesystem
90-
*/
91-
private $filesystem;
92-
93-
/**
94-
* @var Database
90+
* @var FileStorageDatabase
9591
*/
9692
private $fileStorageDatabase;
93+
9794
/**
9895
* @var StoreManagerInterface
9996
*/
@@ -108,9 +105,9 @@ class ImageResize
108105
* @param ViewConfig $viewConfig
109106
* @param AssertImageFactory $assertImageFactory
110107
* @param ThemeCustomizationConfig $themeCustomizationConfig
111-
* @param Collection $themeCollection
108+
* @param ThemeCollection $themeCollection
112109
* @param Filesystem $filesystem
113-
* @param Database $fileStorageDatabase
110+
* @param FileStorageDatabase $fileStorageDatabase
114111
* @param StoreManagerInterface $storeManager
115112
* @throws \Magento\Framework\Exception\FileSystemException
116113
* @internal param ProductImage $gallery
@@ -125,9 +122,9 @@ public function __construct(
125122
ViewConfig $viewConfig,
126123
AssertImageFactory $assertImageFactory,
127124
ThemeCustomizationConfig $themeCustomizationConfig,
128-
Collection $themeCollection,
125+
ThemeCollection $themeCollection,
129126
Filesystem $filesystem,
130-
Database $fileStorageDatabase = null,
127+
FileStorageDatabase $fileStorageDatabase = null,
131128
StoreManagerInterface $storeManager = null
132129
) {
133130
$this->appState = $appState;
@@ -140,9 +137,8 @@ public function __construct(
140137
$this->themeCustomizationConfig = $themeCustomizationConfig;
141138
$this->themeCollection = $themeCollection;
142139
$this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
143-
$this->filesystem = $filesystem;
144140
$this->fileStorageDatabase = $fileStorageDatabase ?:
145-
ObjectManager::getInstance()->get(Database::class);
141+
ObjectManager::getInstance()->get(FileStorageDatabase::class);
146142
$this->storeManager = $storeManager ?? ObjectManager::getInstance()->get(StoreManagerInterface::class);
147143
}
148144

app/code/Magento/MediaStorage/Test/Unit/Service/ImageResizeTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
use Magento\Framework\App\Filesystem\DirectoryList;
2525

2626
/**
27-
* Class ImageResizeTest
28-
*
2927
* @SuppressWarnings(PHPMD.TooManyFields)
3028
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3129
*/

0 commit comments

Comments
 (0)