LEtudiant\Composer\Data\Package\PackageDataManagerInterface::removePackageUsage PHP Method

removePackageUsage() public method

Remove the row in the "packages.json" file
public removePackageUsage ( Composer\Package\PackageInterface $package )
$package Composer\Package\PackageInterface
    public function removePackageUsage(PackageInterface $package);

Usage Example

 /**
  * @param InstalledRepositoryInterface $repo
  * @param PackageInterface             $package
  *
  * @throws FilesystemException
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if ($this->isSourceDirUnused($package) && $this->io->askConfirmation("The package version <info>" . $package->getPrettyName() . "</info> " . "(<fg=yellow>" . $package->getPrettyVersion() . "</fg=yellow>) seems to be unused." . PHP_EOL . 'Do you want to <fg=red>delete the source folder</fg=red> ? [y/n] (default: no) : ', false)) {
         $this->packageDataManager->setPackageInstallationSource($package);
         parent::uninstall($repo, $package);
     } else {
         $this->binaryInstaller->removeBinaries($package);
         $repo->removePackage($package);
     }
     $this->packageDataManager->removePackageUsage($package);
     $this->removePackageVendorSymlink($package);
 }