* * @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:----cWGwNfFLQKA0rB6a4dwlENhx/lvg0Eh1zf0cjtguW/5Cj/TqkOCx+tiaaAmcKs8sM/sdtS4sPbZD6MtNgR8gpjb3ZX5/G6zDEyZIknI/8gRLQZNERKyst09I1y7USsY1B3CIIDUTnQG3cx2Ax9irEX6F6BGr1tz+y6NAq67VAOXtPQuJRbe4xdbN9m7R5Ab7k5mNCSAEPR4IGaxiwNUAI/ZoOw7x52mG5CL8c7pYFsI1qO6KOGL2tFDTk9vjIbpnT4l9zD90pPQXC4U6zzkw4xU5gnZvI2RN6YqbUv9WD7Ha0hNsk7XA5crngjyOSGIAWpJykHVo77/IHUAwWrSG6/78QF4FkiLHPygs1gJwrgIUp2vlZu057mlhzHvX8T1NcBufvANZEvSHMnS9VdyD3sT10/DeWDbFFNS5nz8rsERA0cg5whf4k4LfDA3rlKFfxGCitj5cqTJUuy9P6bFQOJYyl2o9Qx8NbtNdn1+hR3Cdp0A7spOEVZ6JEeK5CLvwHPUPF6uodYosdm/kdFVoV92wpUBBL59E4tiUTHCCQnPMIk2gIe3aRIdS40llmv1skAMcoW7FXb7Wpk8mFz4dT30rB7EUlkaiod7UIrKvJIQG0Gopu5xJbhvKbQ7lvDrGrBaQJMKJe6c3uOaBTIfQO+XoaFhyBhxi4elmjNvS/js=----ATTACHMENT:----NTE0NzkzMDExNTA2MjQ2NCA2MzE2NDc0NDU5NzMxMDE0IDIwOTM4Njc1MzE3ODYyOTQ=