@@ -72,12 +72,12 @@ class MagentoImport implements PreProcessorInterface, ResetAfterRequestInterface
72
72
/**
73
73
* @var DeploymentConfig
74
74
*/
75
- private $ deploymentConfig ;
75
+ private DeploymentConfig $ deploymentConfig ;
76
76
77
77
/**
78
78
* @var ModuleManager
79
79
*/
80
- private $ moduleManager ;
80
+ private ModuleManager $ moduleManager ;
81
81
82
82
/**
83
83
* @param DesignInterface $design
@@ -140,21 +140,12 @@ protected function replace(array $matchedContent, LocalInterface $asset)
140
140
$ moduleName = $ importFile ->getModule ();
141
141
$ referenceString = $ isReference ? '(reference) ' : '' ;
142
142
143
- if (!$ moduleName ) {
144
- $ importsContent .= "@import $ referenceString' {$ matchedFileId }'; \n" ;
145
- }
146
-
147
143
if ($ moduleName ) {
148
- if (!$ deployOnlyEnabled ) {
144
+ if (!$ deployOnlyEnabled || $ this -> moduleManager -> isEnabled ( $ moduleName ) ) {
149
145
$ importsContent .= "@import $ referenceString' {$ moduleName }:: {$ resolvedPath }'; \n" ;
150
- } else {
151
- if (!$ this ->moduleManager ->isEnabled ($ moduleName )) {
152
- continue ;
153
- }
154
-
155
- $ importsContent .= "@import $ referenceString' {$ moduleName }:: {$ resolvedPath }'; \n" ;
156
-
157
146
}
147
+ } else {
148
+ $ importsContent .= "@import $ referenceString' {$ matchedFileId }'; \n" ;
158
149
}
159
150
}
160
151
} catch (\LogicException $ e ) {
@@ -169,7 +160,7 @@ protected function replace(array $matchedContent, LocalInterface $asset)
169
160
*
170
161
* @return bool
171
162
*/
172
- protected function hasEnabledFlagDeployEnabledModules (): bool
163
+ private function hasEnabledFlagDeployEnabledModules (): bool
173
164
{
174
165
return (bool ) $ this ->deploymentConfig ->get (self ::CONFIG_PATH_SCD_ONLY_ENABLED_MODULES );
175
166
}
0 commit comments