original_string: public function removePackage(array $packageNames, $areDevPackages = false)
      {
          $packages = $this->formatPackageNames($packageNames);
          $file = $this->embeddedComposer->getExternalComposerFilename();
          $jsonFile = new JsonFile($file);
          $json = new JsonConfigSource($jsonFile);
          $composerDefinition = $jsonFile->read();
          $type = $areDevPackages ? 'require-dev' : 'require';
  
          foreach ($packages as $name => $version) {
              if (isset($composerDefinition[$type][$name])) {
                  $json->removeLink($type, $name);
                  unset($composerDefinition[$type][$name]);
  
                  continue;
              }
  
              $this->io->writeError(sprintf(
                 'Package: "%s" is not required and has not been removed.',
                 $name
              ));
          }
  
          return $composerDefinition[$type];
      }
code: public function removePackage(array $packageNames, $areDevPackages = false)
      {
          $packages = $this->formatPackageNames($packageNames);
          $file = $this->embeddedComposer->getExternalComposerFilename();
          $jsonFile = new JsonFile($file);
          $json = new JsonConfigSource($jsonFile);
          $composerDefinition = $jsonFile->read();
          $type = $areDevPackages ? 'require-dev' : 'require';
  
          foreach ($packages as $name => $version) {
              if (isset($composerDefinition[$type][$name])) {
                  $json->removeLink($type, $name);
                  unset($composerDefinition[$type][$name]);
  
                  continue;
              }
  
              $this->io->writeError(sprintf(
                 'Package: "%s" is not required and has not been removed.',
                 $name
              ));
          }
  
          return $composerDefinition[$type];
      }
code_tokens: public function removePackage ( array $ packageNames , $ areDevPackages = false ) { $ packages = $ this -> formatPackageNames ( $ packageNames ) ; $ file = $ this -> embeddedComposer -> getExternalComposerFilename ( ) ; $ jsonFile = new JsonFile ( $ file ) ; $ json = new JsonConfigSource ( $ jsonFile ) ; $ composerDefinition = $ jsonFile -> read ( ) ; $ type = $ areDevPackages ? 'require-dev' : 'require' ; foreach ( $ packages as $ name => $ version ) { if ( isset ( $ composerDefinition [ $ type ] [ $ name ] ) ) { $ json -> removeLink ( $ type , $ name ) ; unset ( $ composerDefinition [ $ type ] [ $ name ] ) ; continue ; } $ this -> io -> writeError ( sprintf ( 'Package: "%s" is not required and has not been removed.' , $ name ) ) ; } return $ composerDefinition [ $ type ] ; }
docstring: Remove a set of packages of the current Composer file.
  
  @param array $packageNames
  @param bool  $areDevPackages
  
  @return array List of package's name as a key and the package's version
  as value
docstring_tokens: Remove a set of packages of the current Composer file .