Code Duplication    Length = 10-13 lines in 5 locations

core/EE_Config.core.php 5 locations

@@ 553-565 (lines=13) @@
550
            foreach ($tests_to_run as $test) {
551
                switch ($test) {
552
                    // TEST #1 : check that section was set
553
                    case 1 :
554
                        if (empty($section)) {
555
                            if ($display_errors) {
556
                                throw new EE_Error(
557
                                    sprintf(
558
                                        __(
559
                                            'No configuration section has been provided while attempting to save "%s".',
560
                                            'event_espresso'
561
                                        ),
562
                                        $config_class
563
                                    )
564
                                );
565
                            }
566
                            return false;
567
                        }
568
                        break;
@@ 570-580 (lines=11) @@
567
                        }
568
                        break;
569
                    // TEST #2 : check that settings section exists
570
                    case 2 :
571
                        if (! isset($this->{$section})) {
572
                            if ($display_errors) {
573
                                throw new EE_Error(
574
                                    sprintf(
575
                                        __('The "%s" configuration section does not exist.', 'event_espresso'),
576
                                        $section
577
                                    )
578
                                );
579
                            }
580
                            return false;
581
                        }
582
                        break;
583
                    // TEST #3 : check that section is the proper format
@@ 603-612 (lines=10) @@
600
                        }
601
                        break;
602
                    // TEST #4 : check that config section name has been set
603
                    case 4 :
604
                        if (empty($name)) {
605
                            if ($display_errors) {
606
                                throw new EE_Error(
607
                                    __(
608
                                        'No name has been provided for the specific configuration section.',
609
                                        'event_espresso'
610
                                    )
611
                                );
612
                            }
613
                            return false;
614
                        }
615
                        break;
@@ 617-626 (lines=10) @@
614
                        }
615
                        break;
616
                    // TEST #5 : check that a config class name has been set
617
                    case 5 :
618
                        if (empty($config_class)) {
619
                            if ($display_errors) {
620
                                throw new EE_Error(
621
                                    __(
622
                                        'No class name has been provided for the specific configuration section.',
623
                                        'event_espresso'
624
                                    )
625
                                );
626
                            }
627
                            return false;
628
                        }
629
                        break;
@@ 631-643 (lines=13) @@
628
                        }
629
                        break;
630
                    // TEST #6 : verify config class is accessible
631
                    case 6 :
632
                        if (! class_exists($config_class)) {
633
                            if ($display_errors) {
634
                                throw new EE_Error(
635
                                    sprintf(
636
                                        __(
637
                                            'The "%s" class does not exist. Please ensure that an autoloader has been set for it.',
638
                                            'event_espresso'
639
                                        ),
640
                                        $config_class
641
                                    )
642
                                );
643
                            }
644
                            return false;
645
                        }
646
                        break;