@@ -72,12 +72,12 @@ class MagentoImport implements PreProcessorInterface, ResetAfterRequestInterface
7272 /**
7373 * @var DeploymentConfig
7474 */
75- private $ deploymentConfig ;
75+ private DeploymentConfig $ deploymentConfig ;
7676
7777 /**
7878 * @var ModuleManager
7979 */
80- private $ moduleManager ;
80+ private ModuleManager $ moduleManager ;
8181
8282 /**
8383 * @param DesignInterface $design
@@ -140,21 +140,12 @@ protected function replace(array $matchedContent, LocalInterface $asset)
140140 $ moduleName = $ importFile ->getModule ();
141141 $ referenceString = $ isReference ? '(reference) ' : '' ;
142142
143- if (!$ moduleName ) {
144- $ importsContent .= "@import $ referenceString' {$ matchedFileId }'; \n" ;
145- }
146-
147143 if ($ moduleName ) {
148- if (!$ deployOnlyEnabled ) {
144+ if (!$ deployOnlyEnabled || $ this -> moduleManager -> isEnabled ( $ moduleName ) ) {
149145 $ 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-
157146 }
147+ } else {
148+ $ importsContent .= "@import $ referenceString' {$ matchedFileId }'; \n" ;
158149 }
159150 }
160151 } catch (\LogicException $ e ) {
@@ -169,7 +160,7 @@ protected function replace(array $matchedContent, LocalInterface $asset)
169160 *
170161 * @return bool
171162 */
172- protected function hasEnabledFlagDeployEnabledModules (): bool
163+ private function hasEnabledFlagDeployEnabledModules (): bool
173164 {
174165 return (bool ) $ this ->deploymentConfig ->get (self ::CONFIG_PATH_SCD_ONLY_ENABLED_MODULES );
175166 }
0 commit comments