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

addPackageUsage() public method

Add a row in the "packages.json" file, with the project name for the "package/version" key
public addPackageUsage ( Composer\Package\PackageInterface $package )
$package Composer\Package\PackageInterface
    public function addPackageUsage(PackageInterface $package);

Usage Example

 /**
  * @param InstalledRepositoryInterface $repo
  * @param PackageInterface             $package
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (!is_readable($this->getInstallPath($package))) {
         parent::install($repo, $package);
     } elseif (!$repo->hasPackage($package)) {
         $this->binaryInstaller->installBinaries($package, $this->getInstallPath($package));
         $repo->addPackage(clone $package);
     }
     $this->createPackageVendorSymlink($package);
     $this->packageDataManager->addPackageUsage($package);
 }