/**
  * Run Composer dependency check
  *
  * @param array $packages
  * @return array
  * @throws \Exception
  */
 public function runReadinessCheck(array $packages)
 {
     $composerJson = $this->composerJsonFinder->findComposerJson();
     $this->file->copy($composerJson, $this->directoryList->getPath(DirectoryList::VAR_DIR) . '/composer.json');
     $workingDir = $this->directoryList->getPath(DirectoryList::VAR_DIR);
     try {
         foreach ($packages as $package) {
             if (strpos($package, 'magento/product-enterprise-edition') !== false) {
                 $this->magentoComposerApplication->runComposerCommand(['command' => 'remove', 'packages' => ['magento/product-community-edition'], '--no-update' => true], $workingDir);
             }
         }
         $this->requireUpdateDryRunCommand->run($packages, $workingDir);
         return ['success' => true];
     } catch (\RuntimeException $e) {
         $message = str_replace(PHP_EOL, '<br/>', htmlspecialchars($e->getMessage()));
         return ['success' => false, 'error' => $message];
     }
 }