Code Duplication    Length = 10-13 lines in 5 locations

core/EE_Config.core.php 5 locations

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