Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 140-155 (lines=16) @@
137
     *
138
     * @return array
139
     */
140
    public function getRelatedProducts($credentials, $id)
141
    {
142
        $this->checkCredentials($credentials);
143
144
        $this->_factoryWebshop();
145
146
        $product_id = intval($id);
147
148
        if (!is_numeric($product_id)) {
149
            require_once 'XML/RPC2/Exception.php';
150
            throw new XML_RPC2_FaultException('product id must be an integer', -5);
151
        }
152
153
        $product = new Product($this->kernel, $product_id);
154
        return $product->getRelatedProducts();
155
    }
156
157
   /**
158
     * Gets featured products

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

@@ 219-234 (lines=16) @@
216
     *
217
     * @return array
218
     */
219
    public function getRelatedProducts($credentials, $shop_id, $product_id)
220
    {
221
        $this->checkCredentials($credentials);
222
223
        $this->_factoryWebshop($shop_id);
224
225
        if (!is_numeric($product_id)) {
226
            require_once 'XML/RPC2/Exception.php';
227
            throw new XML_RPC2_FaultException('product id must be an integer', -5);
228
        }
229
230
        $product_id = $this->processRequestData(intval($product_id));
231
232
        $product = new Product($this->kernel, $product_id);
233
        return $this->prepareResponseData($product->getRelatedProducts());
234
    }
235
236
   /**
237
     * Gets featured products