Code Duplication    Length = 22-22 lines in 2 locations

src/Intraface/XMLRPC/Shop/Server0100.php 1 location

@@ 570-591 (lines=22) @@
567
     *
568
     * @return array
569
     */
570
    public function getRelatedProducts($credentials, $shop_id, $product_id)
571
    {
572
        $this->checkCredentials($credentials);
573
574
        $this->_factoryWebshop($shop_id);
575
576
        if (!is_numeric($product_id)) {
577
            require_once 'XML/RPC2/Exception.php';
578
            throw new XML_RPC2_FaultException('product id must be an integer', -5);
579
        }
580
581
        $product_id = $this->processRequestData(intval($product_id));
582
583
        if (false !== ($currency_gateway = $this->getCurrencyGateway())) {
584
            $currencies = $currency_gateway->findAllWithExchangeRate();
585
        } else {
586
            $currencies = false;
587
        }
588
589
        $product = new Product($this->kernel, $product_id);
590
        return $this->prepareResponseData($this->cleanUpProductList($product->getRelatedProducts($currencies, 'webshop')));
591
    }
592
593
   /**
594
     * Gets featured products

src/Intraface/XMLRPC/Shop/Server0004.php 1 location

@@ 405-426 (lines=22) @@
402
     *
403
     * @return array
404
     */
405
    public function getRelatedProducts($credentials, $shop_id, $product_id)
406
    {
407
        $this->checkCredentials($credentials);
408
409
        $this->_factoryWebshop($shop_id);
410
411
        if (!is_numeric($product_id)) {
412
            require_once 'XML/RPC2/Exception.php';
413
            throw new XML_RPC2_FaultException('product id must be an integer', -5);
414
        }
415
416
        $product_id = $this->processRequestData(intval($product_id));
417
418
        if (false !== ($currency_gateway = $this->getCurrencyGateway())) {
419
            $currencies = $currency_gateway->findAllWithExchangeRate();
420
        } else {
421
            $currencies = false;
422
        }
423
424
        $product = new Product($this->kernel, $product_id);
425
        return $this->prepareResponseData($this->cleanUpProductList($product->getRelatedProducts($currencies, 'webshop')));
426
    }
427
428
   /**
429
     * Gets featured products