public function resolve(Locker $locker): array
    {
        if (!$this->resolvedLockers->contains($locker)) {
            $lockedPackages = $locker->getLockedRepository()->getPackages();

            $this->resolvedLockers->attach(
                $locker,
                array_map(
                    function (array $packages) use ($lockedPackages) : array {
                        return array_reduce(
                            $lockedPackages,
                            function (
                                array $carry,
                                PackageInterface $package
                            ) use ($packages) : array {
                                if (in_array(
                                    $package->getName(),
                                    $packages,
                                    true
                                )) {
                                    $carry[] = $package;
                                }

                                return $carry;
                            },
                            []
                        );
                    },
                    $this->resolveGraph(
                        ...$locker->getLockData()['packages'] ?? []
                    )
                )
            );
        }

        return $this->resolvedLockers->offsetGet($locker);
    }
public function resolve(Locker $locker): array
    {
        if (!$this->resolvedLockers->contains($locker)) {
            $lockedPackages = $locker->getLockedRepository()->getPackages();

            $this->resolvedLockers->attach(
                $locker,
                array_map(
                    function (array $packages) use ($lockedPackages) : array {
                        return array_reduce(
                            $lockedPackages,
                            function (
                                array $carry,
                                PackageInterface $package
                            ) use ($packages) : array {
                                if (in_array(
                                    $package->getName(),
                                    $packages,
                                    true
                                )) {
                                    $carry[] = $package;
                                }

                                return $carry;
                            },
                            []
                        );
                    },
                    $this->resolveGraph(
                        ...$locker->getLockData()['packages'] ?? []
                    )
                )
            );
        }

        return $this->resolvedLockers->offsetGet($locker);
    }
public function resolve ( Locker $ locker ) : array { if ( ! $ this -> resolvedLockers -> contains ( $ locker ) ) { $ lockedPackages = $ locker -> getLockedRepository ( ) -> getPackages ( ) ; $ this -> resolvedLockers -> attach ( $ locker , array_map ( function ( array $ packages ) use ( $ lockedPackages ) : array { return array_reduce ( $ lockedPackages , function ( array $ carry , PackageInterface $ package ) use ( $ packages ) : array { if ( in_array ( $ package -> getName ( ) , $ packages , true ) ) { $ carry [ ] = $ package ; } return $ carry ; } , [ ] ) ; } , $ this -> resolveGraph ( ... $ locker -> getLockData ( ) [ 'packages' ] ?? [ ] ) ) ) ; } return $ this -> resolvedLockers -> offsetGet ( $ locker ) ; }
Resolve the dependents graph for the given Composer locker.

@param Locker $locker

@return array|PackageInterface[][]
Resolve the dependents graph for the given Composer locker .