Code Duplication    Length = 5-7 lines in 2 locations

lib/WebMarketingROI/OptimizelyPHP/OptimizelyApiClient.php 2 locations

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