20
20
use Magento \Framework \View \Design \ThemeInterface ;
21
21
use Magento \Framework \View \DesignInterface ;
22
22
use Magento \Framework \View \File \CollectorInterface ;
23
+ use Magento \Framework \View \Asset \PreProcessor \Chain ;
23
24
24
25
/**
25
26
* @magento_import instruction preprocessor
@@ -104,9 +105,12 @@ public function __construct(
104
105
}
105
106
106
107
/**
107
- * {@inheritdoc}
108
+ * Transform content and/or content type for the specified preprocessing chain object
109
+ *
110
+ * @param Chain $chain
111
+ * @return void
108
112
*/
109
- public function process (\ Magento \ Framework \ View \ Asset \ PreProcessor \ Chain $ chain )
113
+ public function process (Chain $ chain ): void
110
114
{
111
115
$ asset = $ chain ->getAsset ();
112
116
$ replaceCallback = function ($ matchContent ) use ($ asset ) {
@@ -122,7 +126,7 @@ public function process(\Magento\Framework\View\Asset\PreProcessor\Chain $chain)
122
126
* @param LocalInterface $asset
123
127
* @return string
124
128
*/
125
- protected function replace (array $ matchedContent , LocalInterface $ asset )
129
+ protected function replace (array $ matchedContent , LocalInterface $ asset ): string
126
130
{
127
131
$ importsContent = '' ;
128
132
try {
@@ -157,7 +161,7 @@ protected function replace(array $matchedContent, LocalInterface $asset)
157
161
* @param LocalInterface $asset
158
162
* @return ThemeInterface
159
163
*/
160
- protected function getTheme (LocalInterface $ asset )
164
+ protected function getTheme (LocalInterface $ asset ): ThemeInterface
161
165
{
162
166
$ context = $ asset ->getContext ();
163
167
if ($ context instanceof FallbackContext) {
@@ -169,10 +173,12 @@ protected function getTheme(LocalInterface $asset)
169
173
}
170
174
171
175
/**
176
+ * Retrieve theme provider instance
177
+ *
172
178
* @return ThemeProviderInterface
173
179
* @deprecated 100.1.1
174
180
*/
175
- private function getThemeProvider ()
181
+ private function getThemeProvider (): ThemeProviderInterface
176
182
{
177
183
if (null === $ this ->themeProvider ) {
178
184
$ this ->themeProvider = ObjectManager::getInstance ()->get (ThemeProviderInterface::class);
0 commit comments