* * @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 { // unwrap filter repos 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:----vmPDamGbIMgDiUyZ7cHvAYfQB1SPcwruKGXELAaP2NU9EmKyNkGiIP4MBY3nP3LYvSqPcYQ252szdraeIi8+sMFNjjgFjfEd80pNMvHL5hsEwP0AhrGbm/1KynJ8xWqFVsoevygs9vliQzfb33oxZV2G4cl2YeUGUYjulEGe892TH7hK2V8/HK6jcdOHSUicuHHSEuU2Lz1QgxMqjbj18bps2vi40tBNk6WtoFblhTsvQKLRZePN8puMhEHVcO2Zbuhpbacv7ll77o9ULHE+3e9uoUBxJ5+oRBpMKOfzwaeAyPf5noH4FFg/9zQZOxTYtZvorp8bqHRAX1323wI+uuQfgIsZeR4yr37w6c+HkEoCzlMLNerkU2Ouw3uNmh3OBxtEtfOpj6aRV5oywTWnTs3MR4j+eqvqHLU3zkjBD+mcQUpqy1oF5hZ9erBJMrRIu+TLn0T4Xx2Aca3gfugpEljqrlNCDV0/OSFQHehzXb+0vhxGFXOgOjAxovTQW77OroGnqbSIfwO90oR+wqr/zPtP8Jp29qSmxa8B6ctoCDRWbAo0fps7RN2xlJ9tVdqyT+e9j+3CMlbDb1tlMV5uS0GC/P5ucZxRHQlXdAr5Y+3s9xMeDuzt5IcDp1hnILT8WoJfB6MO6etuvrIRgVOsCbCuMp0SlbSQCrCY3ii1aM8=----ATTACHMENT:----NzA1ODEzMzYzNTgxMjcwOSA0MDA0NzAyMTkwMjY4OTQ4IDYzMjg4NDU1NzQ4NDY4NDQ=