/**
  * Rescan package availability and recreates the PackageStates configuration.
  */
 public function rescanCommand()
 {
     $packageStates = $this->packageManager->rescanPackages();
     $this->outputLine('The following packages are registered and will be loaded in this order:');
     $this->outputLine('');
     foreach ($packageStates['packages'] as $composerName => $packageState) {
         $this->outputLine($composerName);
     }
     $this->outputLine('');
     $this->outputLine('Package rescan successful.');
 }