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);
    }