/**
  * Retrieve the packages to obtain.
  *
  * @param ComposerInformation $composer The composer information.
  *
  * @return string[]
  *
  * @throws \LogicException When require-dev shall get included but the current package is not the root package.
  */
 private function filteredPackages(ComposerInformation $composer)
 {
     $packages = [];
     if ($this->includeRequire) {
         if (true === $this->includeRequire) {
             $packages = $composer->getDependencies($this->name, $this->excludeDependencies);
         } else {
             $packages = $this->includeRequire;
         }
     }
     $packages = array_merge($packages, [$this->name]);
     if ($this->includeRequireDev) {
         if ($this->name !== $composer->getRootPackageName()) {
             throw new \LogicException('Inclusion of require-dev from ' . $this->name . ' requested but it is not the root package.');
         }
         if (true === $this->includeRequireDev) {
             $packages = array_merge($packages, $composer->getDevDependencies());
         }
     }
     $exclude = $this->excludeDependencies;
     $excTypes = ['platform', 'metapackage'];
     $packages = array_filter($packages, function ($package) use($exclude, $excTypes, $composer) {
         return !(in_array($package, $exclude) || in_array($composer->getPackageType($package), $excTypes));
     });
     return $packages;
 }