Issues (13)

src/Utils/RepositoryUtils.php (1 issue)

Severity
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
The method getDependents() does not exist on Composer\Repository\CompositeRepository. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
        $dependentsList = array_map('reset', $depsRepository->/** @scrutinizer ignore-call */ getDependents($dependencyName));
Loading history...
26
27
        return array_filter($dependentsList);
28
    }
29
}
30