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

getPackageUsage() public method

Return usage of the current package
public getPackageUsage ( Composer\Package\PackageInterface $package ) : array
$package Composer\Package\PackageInterface
return array
    public function getPackageUsage(PackageInterface $package);

Usage Example

 /**
  * Detect if other project use the dependency by using the "packages.json" file
  *
  * @param PackageInterface $package
  *
  * @return bool
  */
 protected function isSourceDirUnused(PackageInterface $package)
 {
     $usageData = $this->packageDataManager->getPackageUsage($package);
     return sizeof($usageData) <= 1;
 }