src/Models/Response.php
public function parseResponse(array $response, MappingInterface $responseItemHandler)
    {
        $responseItemHandler = ($responseItemHandler !== null ? $responseItemHandler : new ResponseItemData);

        $this->page = (!empty($response['page']) ? intval($response['page']) : 0);
        $this->resultsPerPage = (!empty($response['results_per_page']) ? intval($response['results_per_page']) : 0);
        $this->resultsSize = (!empty($response['results_size']) ? intval($response['results_size']) : 0);
        $this->totalResultsSize = (!empty($response['total_results_size']) ? intval($response['total_results_size']) : 0);
        $this->totalPages = (!empty($response['total_pages']) ? intval($response['total_pages']) : 0);
        $this->nextPage = $response['next_page'];
        $this->prevPage = $response['prev_page'];

        $this->version = $response['version'];
        $this->license = $response['license'];


        $responseItems = new ResponseItem($responseItemHandler);
        $responseItems->setItems($response['results']);


        $this->results = $responseItems->getItems();

        return $this;
    }
public function parseResponse(array $response, MappingInterface $responseItemHandler)
    {
        $responseItemHandler = ($responseItemHandler !== null ? $responseItemHandler : new ResponseItemData);

        $this->page = (!empty($response['page']) ? intval($response['page']) : 0);
        $this->resultsPerPage = (!empty($response['results_per_page']) ? intval($response['results_per_page']) : 0);
        $this->resultsSize = (!empty($response['results_size']) ? intval($response['results_size']) : 0);
        $this->totalResultsSize = (!empty($response['total_results_size']) ? intval($response['total_results_size']) : 0);
        $this->totalPages = (!empty($response['total_pages']) ? intval($response['total_pages']) : 0);
        $this->nextPage = $response['next_page'];
        $this->prevPage = $response['prev_page'];

        $this->version = $response['version'];
        $this->license = $response['license'];


        $responseItems = new ResponseItem($responseItemHandler);
        $responseItems->setItems($response['results']);


        $this->results = $responseItems->getItems();

        return $this;
    }
@param array $response
@param MappingInterface $responseItemHandler

@todo migrate to a transfomer object
@return Response