9 use Symfony\Component\Console\Output\OutputInterface;
19 private $objectManager;
34 private $setupFactory;
38 private $patchApplier;
51 \
Magento\Framework\Composer\Remove $remove,
55 $this->objectManager = $objectManagerProvider->
get();
56 $this->
remove = $remove;
57 $this->collector = $collector;
58 $this->setupFactory = $setupFactory;
64 private function getPatchApplier()
66 if (!$this->patchApplier) {
67 $this->patchApplier = $this->objectManager->get(PatchApplier::class);
70 return $this->patchApplier;
82 $uninstalls = $this->collector->collectUninstall($modules);
83 $setupModel = $this->setupFactory->create();
85 foreach ($modules as $module) {
86 if (isset($uninstalls[$module])) {
87 $output->writeln(
"<info>Removing data of $module</info>");
88 $uninstalls[$module]->uninstall(
94 $this->getPatchApplier()->revertDataPatches($module);
105 public function uninstallCode(OutputInterface
$output, array $modules)
107 $output->writeln(
'<info>Removing code from Magento codebase:</info>');
110 $packageInfo = $this->objectManager->get(\
Magento\Framework\
Module\PackageInfoFactory::class)->create();
111 foreach ($modules as $module) {
112 $packages[] = $packageInfo->getPackageName($module);
114 $this->
remove->remove($packages);
__construct(ObjectManagerProvider $objectManagerProvider, \Magento\Framework\Composer\Remove $remove, UninstallCollector $collector, \Magento\Setup\Module\SetupFactory $setupFactory)
uninstallData(OutputInterface $output, array $modules)