Code Duplication    Length = 10-13 lines in 5 locations

core/EE_Config.core.php 5 locations

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