public function adaptCommand(): void
    {
        $domains = $this->findDomainsWithRouteDomainName();

        $domainCount = \count($domains);
        if (!$domainCount) {
            $this->outputLine('<warning>Could not find any domain records to adapt. Did you forget to create one or to configure the platform.sh route domain name?');

            return;
        }

        $this->outputLine(\sprintf(
            '<info>Found %d domains to adapt.</info>',
            $domainCount
        ));

        foreach ($domains as $domain) {
            $routeDomainName = $domain['tx_bartacusplatformsh_routeDomainName'];

            try {
                $newDomainName = $this->routeResolver->resolveDomain($routeDomainName);
                $this->updateDomain($routeDomainName, $newDomainName);

                $this->outputLine(\sprintf(
                    'Adapted platform.sh route domain name "%s" to domain name "%s".',
                    $routeDomainName,
                    $newDomainName
                ));
            } catch (RouteDomainNotFound $e) {
                $this->outputLine(\sprintf(
                    '<warning>Could not find matching route for platform.sh route domain name "%s".</warning>',
                    $routeDomainName
                ));
            }
        }
    }