Skip to content

Commit ed12fcd

Browse files
committed
extract logic for moduleSpecificDeployIgnores into separate method
1 parent 9c3d463 commit ed12fcd

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

src/MagentoHackathon/Composer/Magento/Installer/MagentoInstallerAbstract.php

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -289,20 +289,6 @@ public function getDeployStrategy(PackageInterface $package, $strategy = null)
289289
}
290290
}
291291

292-
$moduleSpecificDeployIgnores = array();
293-
if ($this->getConfig()->hasMagentoDeployIgnore()) {
294-
$magentoDeployIgnore = $this->getConfig()->getMagentoDeployIgnore();
295-
if (isset($magentoDeployIgnore['*'])) {
296-
$moduleSpecificDeployIgnores = $magentoDeployIgnore['*'];
297-
}
298-
if (isset($magentoDeployIgnore[$package->getName()])) {
299-
$moduleSpecificDeployIgnores = array_merge(
300-
$moduleSpecificDeployIgnores,
301-
$magentoDeployIgnore[$package->getName()]
302-
);
303-
}
304-
}
305-
306292
$targetDir = $this->getTargetDir();
307293
$sourceDir = $this->getSourceDir($package);
308294
switch ($strategy) {
@@ -321,10 +307,29 @@ public function getDeployStrategy(PackageInterface $package, $strategy = null)
321307
}
322308
// Inject isForced setting from extra config
323309
$impl->setIsForced($this->isForced);
324-
$impl->setIgnoredMappings($moduleSpecificDeployIgnores);
310+
$impl->setIgnoredMappings($this->getModuleSpecificDeployIgnores($package));
325311

326312
return $impl;
327313
}
314+
315+
protected function getModuleSpecificDeployIgnores($package)
316+
{
317+
318+
$moduleSpecificDeployIgnores = array();
319+
if ($this->getConfig()->hasMagentoDeployIgnore()) {
320+
$magentoDeployIgnore = $this->getConfig()->getMagentoDeployIgnore();
321+
if (isset($magentoDeployIgnore['*'])) {
322+
$moduleSpecificDeployIgnores = $magentoDeployIgnore['*'];
323+
}
324+
if (isset($magentoDeployIgnore[$package->getName()])) {
325+
$moduleSpecificDeployIgnores = array_merge(
326+
$moduleSpecificDeployIgnores,
327+
$magentoDeployIgnore[$package->getName()]
328+
);
329+
}
330+
}
331+
return $moduleSpecificDeployIgnores;
332+
}
328333

329334
/**
330335
* Return Source dir of package

0 commit comments

Comments
 (0)