Code Duplication    Length = 25-25 lines in 3 locations

main/inc/lib/pear/PEAR.php 3 locations

@@ 333-357 (lines=25) @@
330
            $setoptions  = &$GLOBALS['_PEAR_default_error_options'];
331
        }
332
333
        switch ($mode) {
334
            case PEAR_ERROR_EXCEPTION:
335
            case PEAR_ERROR_RETURN:
336
            case PEAR_ERROR_PRINT:
337
            case PEAR_ERROR_TRIGGER:
338
            case PEAR_ERROR_DIE:
339
            case null:
340
                $setmode = $mode;
341
                $setoptions = $options;
342
                break;
343
344
            case PEAR_ERROR_CALLBACK:
345
                $setmode = $mode;
346
                // class/object method callback
347
                if (is_callable($options)) {
348
                    $setoptions = $options;
349
                } else {
350
                    trigger_error("invalid error callback", E_USER_WARNING);
351
                }
352
                break;
353
354
            default:
355
                trigger_error("invalid error mode", E_USER_WARNING);
356
                break;
357
        }
358
    }
359
360
    // }}}
@@ 596-620 (lines=25) @@
593
        $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];
594
        $def_options = &$GLOBALS['_PEAR_default_error_options'];
595
        $stack[] = array($def_mode, $def_options);
596
        switch ($mode) {
597
            case PEAR_ERROR_EXCEPTION:
598
            case PEAR_ERROR_RETURN:
599
            case PEAR_ERROR_PRINT:
600
            case PEAR_ERROR_TRIGGER:
601
            case PEAR_ERROR_DIE:
602
            case null:
603
                $def_mode = $mode;
604
                $def_options = $options;
605
                break;
606
607
            case PEAR_ERROR_CALLBACK:
608
                $def_mode = $mode;
609
                // class/object method callback
610
                if (is_callable($options)) {
611
                    $def_options = $options;
612
                } else {
613
                    trigger_error("invalid error callback", E_USER_WARNING);
614
                }
615
                break;
616
617
            default:
618
                trigger_error("invalid error mode", E_USER_WARNING);
619
                break;
620
        }
621
        $stack[] = array($mode, $options);
622
        return true;
623
    }
@@ 633-657 (lines=25) @@
630
        array_pop($stack);
631
        list($mode, $options) = $stack[sizeof($stack) - 1];
632
        array_pop($stack);
633
        switch ($mode) {
634
            case PEAR_ERROR_EXCEPTION:
635
            case PEAR_ERROR_RETURN:
636
            case PEAR_ERROR_PRINT:
637
            case PEAR_ERROR_TRIGGER:
638
            case PEAR_ERROR_DIE:
639
            case null:
640
                $setmode = $mode;
641
                $setoptions = $options;
642
                break;
643
644
            case PEAR_ERROR_CALLBACK:
645
                $setmode = $mode;
646
                // class/object method callback
647
                if (is_callable($options)) {
648
                    $setoptions = $options;
649
                } else {
650
                    trigger_error("invalid error callback", E_USER_WARNING);
651
                }
652
                break;
653
654
            default:
655
                trigger_error("invalid error mode", E_USER_WARNING);
656
                break;
657
        }
658
        return true;
659
    }
660