src/Visithor/Generator/UrlGenerator.php
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;
    }
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;
    }
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 ; }
Given a config array, create an URLChain instance filled with all defined
URL instances.

@param array    $config           Configuration
@param string[] $defaultHTTPCodes Array of HTTP Codes
@param array    $defaultOptions   Default options

@return Url[] Array of URL instances
Given a config array create an URLChain instance filled with all defined URL instances .