| Total Complexity | 6 |
| Total Lines | 72 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class DependentsResolver implements DependentsResolverInterface |
||
| 13 | { |
||
| 14 | /** @var CompositeRepository */ |
||
| 15 | private $repository; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Constructor. |
||
| 19 | * |
||
| 20 | * @param RepositoryInterface $repository |
||
| 21 | */ |
||
| 22 | 1 | public function __construct(RepositoryInterface $repository) |
|
| 25 | 1 | } |
|
| 26 | |||
| 27 | /** |
||
| 28 | * Resolves the dependents of the package. |
||
| 29 | * |
||
| 30 | * @param string $packageName |
||
| 31 | * |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | 5 | public function resolve(string $packageName): array |
|
| 35 | { |
||
| 36 | 5 | return $this->getDependents( |
|
| 37 | 5 | $packageName, |
|
| 38 | 5 | false, |
|
| 39 | 5 | [] |
|
| 40 | ); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Retrieves the dependents of a package in a recursive way. |
||
| 45 | * |
||
| 46 | * @param string $packageName |
||
| 47 | * @param bool $returnContext |
||
| 48 | * @param array $context |
||
| 49 | * |
||
| 50 | * @return array |
||
| 51 | */ |
||
| 52 | 10 | private function getDependents( |
|
| 84 | } |
||
| 85 | } |
||
| 86 |