| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Copyright © Vaimo Group. All rights reserved. |
||
| 4 | * See LICENSE_VAIMO.txt for license details. |
||
| 5 | */ |
||
| 6 | namespace Vaimo\ComposerPatches\Utils; |
||
| 7 | |||
| 8 | use Composer\Repository\WritableRepositoryInterface; |
||
| 9 | |||
| 10 | class RepositoryUtils |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var \Vaimo\ComposerPatches\Compatibility\DependenciesFactory |
||
| 14 | */ |
||
| 15 | private $composerDependencies; |
||
| 16 | |||
| 17 | public function __construct() |
||
| 18 | { |
||
| 19 | $this->composerDependencies = new \Vaimo\ComposerPatches\Compatibility\DependenciesFactory(); |
||
| 20 | } |
||
| 21 | |||
| 22 | public function filterByDependency(WritableRepositoryInterface $repository, $dependencyName) |
||
| 23 | { |
||
| 24 | $depsRepository = $this->composerDependencies->createCompositeRepository($repository); |
||
| 25 | $dependents = $depsRepository->getDependents($dependencyName); |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 26 | $dependentsList = array_column($dependents, 0); |
||
| 27 | |||
| 28 | return array_filter($dependentsList); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |