src/FACTFinder/Core/Server/EasyCurlDataProvider.php
public function loadResponse($id)
    {
        if (!isset($this->connectionData[$id]))
            throw new \InvalidArgumentException('Tried to get response for invalid ID $id.');

        if (!$this->hasUrlChanged($id))
            return;

        $connectionData = $this->connectionData[$id];

        $action = $connectionData->getAction();
        if (empty($action))
        {
            $this->log->error('Request type missing.');
            $connectionData->setNullResponse();
            return;
        }

        $httpHeaderFields = $this->prepareHttpHeaders($connectionData);
        $parameters = $this->prepareParameters($connectionData);
        $url = $this->prepareConnectionOptions(
            $connectionData,
            $httpHeaderFields,
            $parameters
        );

        $response = $this->retrieveResponse($connectionData);

        $connectionData->setResponse($response, $url);

        $this->logResult($response);
    }
public function loadResponse($id)
    {
        if (!isset($this->connectionData[$id]))
            throw new \InvalidArgumentException('Tried to get response for invalid ID $id.');

        if (!$this->hasUrlChanged($id))
            return;

        $connectionData = $this->connectionData[$id];

        $action = $connectionData->getAction();
        if (empty($action))
        {
            $this->log->error('Request type missing.');
            $connectionData->setNullResponse();
            return;
        }

        $httpHeaderFields = $this->prepareHttpHeaders($connectionData);
        $parameters = $this->prepareParameters($connectionData);
        $url = $this->prepareConnectionOptions(
            $connectionData,
            $httpHeaderFields,
            $parameters
        );

        $response = $this->retrieveResponse($connectionData);

        $connectionData->setResponse($response, $url);

        $this->logResult($response);
    }
TODO: Could this be refactored some more?