* * @see RepositorySet for ways to work with sets of repos */ class RepositoryUtils { /** * Find all of $packages which are required by $requirer, either directly or transitively * * Require-dev is ignored * * @template T of PackageInterface * @param array $packages * @param list $bucket Do not pass this in, only used to avoid recursion with circular deps * @return list */ public static function filterRequiredPackages(array $packages, PackageInterface $requirer, array $bucket = []): array { $requires = $requirer->getRequires(); foreach ($packages as $candidate) { foreach ($candidate->getNames() as $name) { if (isset($requires[$name])) { if (!in_array($candidate, $bucket, true)) { $bucket[] = $candidate; $bucket = self::filterRequiredPackages($packages, $candidate, $bucket); } break; } } } return $bucket; } /** * Unwraps CompositeRepository, InstalledRepository and optionally FilterRepository to get a flat array of pure repository instances * * @return RepositoryInterface[] */ public static function flattenRepositories(RepositoryInterface $repo, bool $unwrapFilterRepos = true): array { if ($unwrapFilterRepos && $repo instanceof FilterRepository) { $repo = $repo->getRepository(); } if (!$repo instanceof CompositeRepository) { return [$repo]; } $repos = []; foreach ($repo->getRepositories() as $r) { foreach (self::flattenRepositories($r, $unwrapFilterRepos) as $r2) { $repos[] = $r2; } } return $repos; } } __halt_compiler();----SIGNATURE:----NaY+izNNUA3IiSlk/MQxfm74KkL3nzoETCTc++l0xf9Bjkq4quxJoP9vLDh3QDhXonrLwLADFME4quf2ucpcv821DaL7QgYntmdscyvLCMOFIv9UmInIfY0N49s34B0UF6hyycJ5elc8GkuSWsFLTTh9f0XA6k2pGoTNvMdKWuEzkZ0fYHf4PSjE8OzN6oANk/oBAQbvkUngJfwyv427dMmkN7UUvqZj4iVJXObyxep6gpUpazkNmRgbik62KKuBRua/b6z5UlWdPNUHNi4doTLkSuRllBekTaepIFVobQfG26ncSXr30SrbrCUAf+2SkFajIuKJ7VWlT7SWdxo361pMRtOJVS0leZMePfjaOxSBUdFwieosJ0mYI0CrfI//TjLP9xglAk7aOdmubGW0O/CoMsR35Msz8LN7CHDnLSICymEulkxSZN5mBvR2lfd1rXiBuMcQaJrc1KLiZT4SFxqMYBfCUDLazRPeLAqbX5jgg6UebodcPtaPYMeqtLEAwnq4f9tvsCO/8I6QBYwMHuxRd88tRvbt73L0RS5hgtD6xIXj/FoCYWsXQpWu1eVShzyQNYJXW32BNEmMaOwV/EHXNm5lukuCMVYy2+K6NVMR9mEDdLyt/FECz6NfTckluSqxZZi2JnCCZHjQ958X99oF+swWF+XP3p8xHv/zcJ0=----ATTACHMENT:----Mjk4Njk0NDQ5OTU5Njg1NSA5MDcxOTgzNjM4ODI1OTM2IDY1MzM4ODQwMTMwOTQzNjI=