private function isDependentPackage(PackageInterface $package, $devMode = false)
    {
        $packages = $package->getRequires();
        if ($devMode) {
            $packages = array_merge($packages, $package->getDevRequires());
        }
        foreach ($packages as $link) {
            /** @var \Composer\Package\Link $link */
            if ($this->targetPackage === $link->getTarget()) {
                return true;
            }
        }
        return false;
    }