@param array  $uriParts
@param string $type
@param array  $options

@return ResponseTypeInterface
3927
protected function get(array $uriParts, $type, array $options = []) {
        $response = $this->request(GDAXConstants::METHOD_GET, $uriParts, $options);
        if (!is_array($response)) {
            throw new \Exception('Received invalid response : ' . $response .' when expecting an array ');
        }
        return (new ResponseContainer)->setRawData($response)->mapResponseToType($type)->getData();
    }
157918
public function execute($type)
    {
        switch (strtolower($type)) {
        case 'markup':
            $curlOptArray = $this->getMarkupOpts();
            break;

        case 'file':
            $curlOptArray = $this->getFileOpts();
            break;

        case 'url':
            $curlOptArray = $this->getUrlOpts();
            break;

        default:
            throw new \PHPUnit_Framework_Exception('Invalid type: '.$type);
            break;
        }

        $curlOptArray = $curlOptArray + array(CURLOPT_RETURNTRANSFER => true,
                                              CURLOPT_TIMEOUT => 10, );

        // Throttle calls (if necessary).
        Throttle::delay(get_class($this));

        $curl = curl_init();
        curl_setopt_array($curl, $curlOptArray);

        if (!$response = curl_exec($curl)) {
            throw new \PHPUnit_Framework_Exception('Unable to validate. Error: '.
                                                   curl_error($curl));
        }

        curl_close($curl);

        return $response;
    }
998448
public function request(string $method, $uri, array $options = []): HttpResultInterface
    {
        $options = $this->prepareDefaults($options);
        $headers = $options['headers'] ?? [];
        $body = $options['body'] ?? null;
        $version = $options['version'] ?? '1.1';
        // Merge the URI into the base URI.
        $uri = $this->buildUri($uri, $options);
        $profileKey = 'http.' . (string)$uri;
        App::profileStart($profileKey);
        $request = new Request($method, $uri, $headers, $body, $version);
        $adapter = $this->getAdapter();
        $this->setDefaultUserAgent();
        $result = $adapter->request($request, $options);
        App::profileEnd($profileKey);
        return $result;
    }
12621
protected function _getTypeOutput(array $options, $url, $type)
    {
        $type = Str::low($type);
        if ($type === 'css') {
            return $this->_getCssOutput($options, $url);
        }

        return $this->_getScriptOutput($options, $url);
    }
266284
public function get($uri, array $options = null)
    {
        return $this->request(self::REQUEST_METHOD_GET, $uri, null, $options);
    }
545947
private function addAsset($type, $uri)
    {
        if(!array_key_exists($type, $this->assets)){
            $this->assets[$type] = array();
        }
        if(!empty($uri) && !in_array($uri, $this->assets[$type])){
            $this->assets[$type][] = $uri;
        }
    }
379160
protected function activeListInput($type, $items, $options = [])
    {
        static $index;
        $name = isset($options['name']) ? $options['name'] : Html::getInputName($this->model, $this->attribute);
        $selection = isset($options['value']) ? $options['value'] : Html::getAttributeValue($this->model, $this->attribute);

        if (!isset($index[$name]) && !array_key_exists('unselect', $options)) {
            $index[$name] = 0;
            $options['unselect'] = '';
        }
        if (!array_key_exists('id', $options)) {
            $options['id'] = Html::getInputId($this->model, $this->attribute);
        }

        return Html::$type($name, $selection, $items, $options);
    }
752120
private function checkQueryResourceId(array $parameters, string $type): void
    {
        if (!$this->resourceId && $parameters['resource_id']) {
            throw new \InvalidArgumentException(\sprintf(
                'Trying to query with a resource ID, but the repository %s does not provide support for them',
                $this->name
            ));
        }
        if (self::ENDPOINT_SINGLE === $type && !$parameters['resource_id']) {
            throw new \InvalidArgumentException(\sprintf(
                'Trying to query a single element without providing a resource ID for repository %s',
                $this->name
            ));
        }
        if (self::ENPOINT_COLLECTION === $type && $parameters['resource_id']) {
            throw new \InvalidArgumentException(\sprintf(
                'Trying to query a collection element by providing a resource ID for repository %s',
                $this->name
            ));
        }
    }
193802
public static function request($method, $uri = '', array $options = [], $origin = false)
    {
        $options = array_merge(['timeout' => 10, 'verify' => false], $options);

        $response = static::$client->request($method, $uri, $options);

        return $origin ? $response : $response->getBody()->getContents();
    }
461365
private function doMultipartUpload ($endpoint, $type, $stream, array $extra = [])
    {
        return json_decode(
            $this->client->send(
                new Request(
                    'POST',
                    Uri::withQueryValue(new Uri($endpoint), 'type', $type),
                    [],
                    new MultipartStream(array_merge([
                        [
                            'name'     => 'media',
                            'contents' => $stream,
                        ],
                    ], $extra))
                )
            )->getBody()
        );
    }
563627
private static function getJsonResource($type, array $options = [])
    {
        if (!array_key_exists($type, self::$cache['resources']) || self::haveOptionsBeenUpdated($type, $options)) {
            self::$cache['options'][$type] = $options;
            self::$cache['resources'][$type] = new JsonResource($type, $options);
        }
        return self::$cache['resources'][$type];
    }
1371536
protected function _handleRedirect($type, $options) {
		if (isset($options[$type . 'RedirectUrl']) && $options[$type . 'RedirectUrl'] !== false) {
			$controller = $this->getController();
			$result = $controller->redirect($options[$type . 'RedirectUrl']);
			$this->_redirectResponse = $result;

			return $result;
		}

		$this->_redirectResponse = null;

		return false;
	}
441045
public function send($method, $uri, array $options = [])
    {
        $request = new Request($method, $uri);

        return $this->client->send($request, $options);
    }
430649
public function setCache($type, array $options = array())
    {
        $this->cacheType = $type;
        $this->cacheOptions = $options;

        return $this;
    }
1303156
public function instance($type = null, $options = array())
	{
		$type = $type ?: $this->getType();

		$signature = serialize(array($type, $options));

		// If the given type has not been created before, we will create the instances
		// here and cache it so we can return it next time very quickly. If there is
		// already a type created by this name, we'll just return that instance.
		if (!isset($this->types[$signature]))
		{
			try
			{
				$document = $this->createType($type, $options);
			}
			catch (Exception $e)
			{
				$document = $this->createType('html', $options);
			}

			$this->types[$signature] = $document;
		}

		return $this->types[$signature];
	}
4023
public function createForm($type, $data = null, array $options = [])
    {
        return $this->application['form.factory']->create($type, $data, $options);
    }
1011313
public function formatter($value, $type, array $options = [], array $variables = [])
    {
        $options = array_replace(['wrapped' => false, 'inherit_data' => false], $options, ['data' => $value]);
        $type = isset($this->aliases[$type]) ? $this->aliases[$type] : $type;

        if (isset($options['entry_type']) && isset($this->aliases[$options['entry_type']])) {
            $options['entry_type'] = $this->aliases[$options['entry_type']];
        }

        /* @var BlockInterface $block */
        $block = $this->createNamed($type, $options);

        return $this->renderer->searchAndRenderBlock($block->createView(), 'widget', $variables);
    }