15
15
use Magento \Framework \App \ObjectManager ;
16
16
use Magento \Framework \Exception \NotFoundException ;
17
17
use Magento \Framework \Filesystem ;
18
+ use Magento \Framework \Filesystem \Directory \WriteInterface ;
18
19
use Magento \Framework \Image ;
19
20
use Magento \Framework \Image \Factory as ImageFactory ;
20
21
use Magento \Catalog \Model \Product \Media \ConfigInterface as MediaConfig ;
21
22
use Magento \Framework \App \State ;
22
23
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 ;
24
25
use Magento \Store \Model \StoreManagerInterface ;
25
26
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 ;
27
28
use Magento \Framework \App \Filesystem \DirectoryList ;
28
- use Magento \MediaStorage \Helper \File \Storage \Database ;
29
+ use Magento \MediaStorage \Helper \File \Storage \Database as FileStorageDatabase ;
29
30
use Magento \Theme \Model \Theme ;
30
31
31
32
/**
@@ -76,24 +77,20 @@ class ImageResize
76
77
private $ themeCustomizationConfig ;
77
78
78
79
/**
79
- * @var Collection
80
+ * @var ThemeCollection
80
81
*/
81
82
private $ themeCollection ;
82
83
83
84
/**
84
- * @var Filesystem
85
+ * @var WriteInterface
85
86
*/
86
87
private $ mediaDirectory ;
87
88
88
89
/**
89
- * @var Filesystem
90
- */
91
- private $ filesystem ;
92
-
93
- /**
94
- * @var Database
90
+ * @var FileStorageDatabase
95
91
*/
96
92
private $ fileStorageDatabase ;
93
+
97
94
/**
98
95
* @var StoreManagerInterface
99
96
*/
@@ -108,9 +105,9 @@ class ImageResize
108
105
* @param ViewConfig $viewConfig
109
106
* @param AssertImageFactory $assertImageFactory
110
107
* @param ThemeCustomizationConfig $themeCustomizationConfig
111
- * @param Collection $themeCollection
108
+ * @param ThemeCollection $themeCollection
112
109
* @param Filesystem $filesystem
113
- * @param Database $fileStorageDatabase
110
+ * @param FileStorageDatabase $fileStorageDatabase
114
111
* @param StoreManagerInterface $storeManager
115
112
* @throws \Magento\Framework\Exception\FileSystemException
116
113
* @internal param ProductImage $gallery
@@ -125,9 +122,9 @@ public function __construct(
125
122
ViewConfig $ viewConfig ,
126
123
AssertImageFactory $ assertImageFactory ,
127
124
ThemeCustomizationConfig $ themeCustomizationConfig ,
128
- Collection $ themeCollection ,
125
+ ThemeCollection $ themeCollection ,
129
126
Filesystem $ filesystem ,
130
- Database $ fileStorageDatabase = null ,
127
+ FileStorageDatabase $ fileStorageDatabase = null ,
131
128
StoreManagerInterface $ storeManager = null
132
129
) {
133
130
$ this ->appState = $ appState ;
@@ -140,9 +137,8 @@ public function __construct(
140
137
$ this ->themeCustomizationConfig = $ themeCustomizationConfig ;
141
138
$ this ->themeCollection = $ themeCollection ;
142
139
$ this ->mediaDirectory = $ filesystem ->getDirectoryWrite (DirectoryList::MEDIA );
143
- $ this ->filesystem = $ filesystem ;
144
140
$ this ->fileStorageDatabase = $ fileStorageDatabase ?:
145
- ObjectManager::getInstance ()->get (Database ::class);
141
+ ObjectManager::getInstance ()->get (FileStorageDatabase ::class);
146
142
$ this ->storeManager = $ storeManager ?? ObjectManager::getInstance ()->get (StoreManagerInterface::class);
147
143
}
148
144
0 commit comments