protected function createUrlChainFromConfig(
        array $config,
        array $defaultHTTPCodes,
        array $defaultOptions
    ) {
        $urlChain = $this
            ->urlChainFactory
            ->create();

        if (
            !isset($config['urls']) ||
            !is_array($config['urls'])
        ) {
            return $urlChain;
        }

        $profiles = (
            isset($config['profiles']) &&
            is_array($config['profiles'])
        )
            ? $config['profiles']
            : [];

        foreach ($config['urls'] as $urlConfig) {
            $urlChain->addUrl(
                $this->getURLInstanceFromConfig(
                    $urlConfig,
                    $defaultHTTPCodes,
                    $defaultOptions,
                    $profiles
                )
            );
        }

        return $urlChain;
    }