Code Duplication    Length = 3-3 lines in 4 locations

application/modules/mod_discount/classes/DiscountManager.php 4 locations

@@ 368-370 (lines=3) @@
365
            $this->error[] = lang('Wrong type discount', 'mod_discount');
366
        }
367
368
        if ($typeDiscount == 'comulativ' && $postArray[$typeDiscount]['end_value'] && !preg_match('/^[0-9]{1,15}$/', $postArray[$typeDiscount]['end_value'])) {
369
            $this->error[] = lang('End value must be numeric');
370
        }
371
372
        if ($typeDiscount == 'comulativ' && $postArray[$typeDiscount]['begin_value'] && !preg_match('/^[0-9]{1,15}$/', $postArray[$typeDiscount]['begin_value'])) {
373
            $this->error[] = lang('Begin value must be numeric');
@@ 372-374 (lines=3) @@
369
            $this->error[] = lang('End value must be numeric');
370
        }
371
372
        if ($typeDiscount == 'comulativ' && $postArray[$typeDiscount]['begin_value'] && !preg_match('/^[0-9]{1,15}$/', $postArray[$typeDiscount]['begin_value'])) {
373
            $this->error[] = lang('Begin value must be numeric');
374
        }
375
376
        if ($typeDiscount == 'certificate' && $postArray[$typeDiscount]['begin_value'] && !preg_match('/^[0-9]{1,15}$/', $postArray[$typeDiscount]['begin_value'])) {
377
            $this->error[] = lang('Begin value must be numeric');
@@ 376-378 (lines=3) @@
373
            $this->error[] = lang('Begin value must be numeric');
374
        }
375
376
        if ($typeDiscount == 'certificate' && $postArray[$typeDiscount]['begin_value'] && !preg_match('/^[0-9]{1,15}$/', $postArray[$typeDiscount]['begin_value'])) {
377
            $this->error[] = lang('Begin value must be numeric');
378
        }
379
380
        if ($typeDiscount == 'all_order' && $postArray[$typeDiscount]['begin_value'] && !preg_match('/^[0-9]{1,15}$/', $postArray[$typeDiscount]['begin_value'])) {
381
            $this->error[] = lang('Begin value must be numeric');
@@ 380-382 (lines=3) @@
377
            $this->error[] = lang('Begin value must be numeric');
378
        }
379
380
        if ($typeDiscount == 'all_order' && $postArray[$typeDiscount]['begin_value'] && !preg_match('/^[0-9]{1,15}$/', $postArray[$typeDiscount]['begin_value'])) {
381
            $this->error[] = lang('Begin value must be numeric');
382
        }
383
384
        if ($postArray['max_apply'] && !preg_match('/^[0-9]{1,15}$/', $postArray['max_apply'])) {
385
            $this->error[] = lang('Max apply must be numeric');