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 | $dependentsList = array_map('reset', $depsRepository->getDependents($dependencyName)); |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
26 | |||
27 | return array_filter($dependentsList); |
||
28 | } |
||
29 | } |
||
30 |