Code Duplication    Length = 24-24 lines in 2 locations

src/Intraface/modules/shop/Basket.php 1 location

@@ 211-234 (lines=24) @@
208
     *
209
     * @return boolean true or false
210
     */
211
    public function saveAddress($input)
212
    {
213
        settype($input['name'], 'string');
214
        settype($input['contactperson'], 'string');
215
        settype($input['address'], 'string');
216
        settype($input['postcode'], 'string');
217
        settype($input['city'], 'string');
218
        settype($input['country'], 'string');
219
        settype($input['cvr'], 'string');
220
        settype($input['email'], 'string');
221
        settype($input['phone'], 'string');
222
223
        $sql = "name = \"".safeToDb($input['name'])."\"," .
224
            "contactperson = \"".safeToDb($input['contactperson'])."\", " .
225
            "address = \"".safeToDb($input['address'])."\", " .
226
            "postcode = \"".safeToDb($input['postcode'])."\", " .
227
            "city = \"".safeToDb($input['city'])."\", ".
228
            "country = \"".safeToDb($input['country'])."\", ".
229
            "cvr = \"".safeToDb($input['cvr'])."\", ".
230
            "email =\"".safeToDb($input['email'])."\", ".
231
            "phone = \"".safeToDb($input['phone'])."\"";
232
233
        return $this->saveToDb($sql);
234
    }
235
236
    /**
237
     * Save customer coupon

src/Intraface/modules/webshop/Basket.php 1 location

@@ 177-200 (lines=24) @@
174
     *
175
     * @return boolean true or false
176
     */
177
    public function saveAddress($input)
178
    {
179
        settype($input['name'], 'string');
180
        settype($input['contactperson'], 'string');
181
        settype($input['address'], 'string');
182
        settype($input['postcode'], 'string');
183
        settype($input['city'], 'string');
184
        settype($input['country'], 'string');
185
        settype($input['cvr'], 'string');
186
        settype($input['email'], 'string');
187
        settype($input['phone'], 'string');
188
189
        $sql = "name = \"".safeToDb($input['name'])."\"," .
190
            "contactperson = \"".safeToDb($input['contactperson'])."\", " .
191
            "address = \"".safeToDb($input['address'])."\", " .
192
            "postcode = \"".safeToDb($input['postcode'])."\", " .
193
            "city = \"".safeToDb($input['city'])."\", ".
194
            "country = \"".safeToDb($input['country'])."\", ".
195
            "cvr = \"".safeToDb($input['cvr'])."\", ".
196
            "email =\"".safeToDb($input['email'])."\", ".
197
            "phone = \"".safeToDb($input['phone'])."\"";
198
199
        return $this->saveToDb($sql);
200
    }
201
202
    /**
203
     * Save customer coupon