Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console / src / Command / Module / UninstallCommand.php
index c5d8fac20b787f814c10bbfb0217feaf7a0d0f3c..6b8bfae378cefc1e46d13afc388b1c772c74b397 100755 (executable)
@@ -8,6 +8,7 @@
 namespace Drupal\Console\Command\Module;
 
 use Drupal\Console\Core\Command\Shared\CommandTrait;
+use Drupal\Console\Extension\Manager;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputOption;
@@ -16,7 +17,6 @@ use Symfony\Component\Console\Command\Command;
 use Drupal\Console\Command\Shared\ProjectDownloadTrait;
 use Drupal\Console\Core\Style\DrupalStyle;
 use Drupal\Console\Utils\Site;
-use Drupal\Console\Utils\Validator;
 use Drupal\Core\ProxyClass\Extension\ModuleInstaller;
 use Drupal\Console\Core\Utils\ChainQueue;
 use Drupal\Core\Config\ConfigFactory;
@@ -32,8 +32,8 @@ class UninstallCommand extends Command
     protected $site;
 
     /**
- * @var ModuleInstaller
-*/
    * @var ModuleInstaller
+     */
     protected $moduleInstaller;
 
     /**
@@ -42,29 +42,36 @@ class UninstallCommand extends Command
     protected $chainQueue;
 
     /**
- * @var ConfigFactory
-*/
    * @var ConfigFactory
+     */
     protected $configFactory;
 
+    /**
+     * @var Manager
+     */
+    protected $extensionManager;
 
     /**
      * InstallCommand constructor.
      *
-     * @param Site          $site
-     * @param Validator     $validator
-     * @param ChainQueue    $chainQueue
-     * @param ConfigFactory $configFactory
+     * @param Site            $site
+     * @param ModuleInstaller $moduleInstaller
+     * @param ChainQueue      $chainQueue
+     * @param ConfigFactory   $configFactory
+     * @param Manager         $extensionManager
      */
     public function __construct(
         Site $site,
         ModuleInstaller $moduleInstaller,
         ChainQueue $chainQueue,
-        ConfigFactory $configFactory
+        ConfigFactory $configFactory,
+        Manager $extensionManager
     ) {
         $this->site = $site;
         $this->moduleInstaller = $moduleInstaller;
         $this->chainQueue = $chainQueue;
         $this->configFactory = $configFactory;
+        $this->extensionManager = $extensionManager;
         parent::__construct();
     }
 
@@ -83,13 +90,13 @@ class UninstallCommand extends Command
             )
             ->addOption(
                 'force',
-                '',
+                null,
                 InputOption::VALUE_NONE,
                 $this->trans('commands.module.uninstall.options.force')
             )
             ->addOption(
                 'composer',
-                '',
+                null,
                 InputOption::VALUE_NONE,
                 $this->trans('commands.module.uninstall.options.composer')
             );
@@ -209,6 +216,7 @@ class UninstallCommand extends Command
             return 1;
         }
 
+        $this->site->removeCachedServicesFile();
         $this->chainQueue->addCommand('cache:rebuild', ['cache' => 'all']);
     }
 }