Code Duplication    Length = 5-7 lines in 2 locations

lib/WebMarketingROI/OptimizelyPHP/OptimizelyApiClient.php 2 locations

@@ 370-374 (lines=5) @@
367
                $rel = $match[2];
368
                
369
                $matched = preg_match('/page=(\d+)/U', $url, $pageMatches);
370
                if (!$matched || count($pageMatches)!=2) {
371
                    throw new Exception('Error extracting page argument while parsing LINK header: ' . 
372
                            $parsedHeaders['link'], Exception::CODE_API_ERROR, 
373
                            array('http_code'=>$httpCode));
374
                }
375
                
376
                $pageNumber = $pageMatches[1];
377
                
@@ 382-388 (lines=7) @@
379
                    $result->setPrevPage($pageNumber);
380
                } else if ($rel=='next') {
381
                    $result->setNextPage($pageNumber);
382
                } else if ($rel=='last') {
383
                    $result->setLastPage($pageNumber);
384
                } else {
385
                    throw new Exception('Unexpected rel argument while parsing LINK header: ' . 
386
                            $parsedHeaders['link'], Exception::CODE_API_ERROR, 
387
                            array('http_code'=>$httpCode));
388
                }
389
            }
390
        }        
391