Code Duplication    Length = 10-13 lines in 5 locations

core/EE_Config.core.php 5 locations

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