Code Duplication    Length = 10-13 lines in 5 locations

core/EE_Config.core.php 5 locations

@@ 542-554 (lines=13) @@
539
            foreach ($tests_to_run as $test) {
540
                switch ($test) {
541
                    // TEST #1 : check that section was set
542
                    case 1:
543
                        if (empty($section)) {
544
                            if ($display_errors) {
545
                                throw new EE_Error(
546
                                    sprintf(
547
                                        __(
548
                                            'No configuration section has been provided while attempting to save "%s".',
549
                                            'event_espresso'
550
                                        ),
551
                                        $config_class
552
                                    )
553
                                );
554
                            }
555
                            return false;
556
                        }
557
                        break;
@@ 559-569 (lines=11) @@
556
                        }
557
                        break;
558
                    // TEST #2 : check that settings section exists
559
                    case 2:
560
                        if (! isset($this->{$section})) {
561
                            if ($display_errors) {
562
                                throw new EE_Error(
563
                                    sprintf(
564
                                        __('The "%s" configuration section does not exist.', 'event_espresso'),
565
                                        $section
566
                                    )
567
                                );
568
                            }
569
                            return false;
570
                        }
571
                        break;
572
                    // TEST #3 : check that section is the proper format
@@ 591-600 (lines=10) @@
588
                        }
589
                        break;
590
                    // TEST #4 : check that config section name has been set
591
                    case 4:
592
                        if (empty($name)) {
593
                            if ($display_errors) {
594
                                throw new EE_Error(
595
                                    __(
596
                                        'No name has been provided for the specific configuration section.',
597
                                        'event_espresso'
598
                                    )
599
                                );
600
                            }
601
                            return false;
602
                        }
603
                        break;
@@ 605-614 (lines=10) @@
602
                        }
603
                        break;
604
                    // TEST #5 : check that a config class name has been set
605
                    case 5:
606
                        if (empty($config_class)) {
607
                            if ($display_errors) {
608
                                throw new EE_Error(
609
                                    __(
610
                                        'No class name has been provided for the specific configuration section.',
611
                                        'event_espresso'
612
                                    )
613
                                );
614
                            }
615
                            return false;
616
                        }
617
                        break;
@@ 619-631 (lines=13) @@
616
                        }
617
                        break;
618
                    // TEST #6 : verify config class is accessible
619
                    case 6:
620
                        if (! class_exists($config_class)) {
621
                            if ($display_errors) {
622
                                throw new EE_Error(
623
                                    sprintf(
624
                                        __(
625
                                            'The "%s" class does not exist. Please ensure that an autoloader has been set for it.',
626
                                            'event_espresso'
627
                                        ),
628
                                        $config_class
629
                                    )
630
                                );
631
                            }
632
                            return false;
633
                        }
634
                        break;