Code Duplication    Length = 10-13 lines in 5 locations

core/EE_Config.core.php 5 locations

@@ 506-518 (lines=13) @@
503
			foreach ( $tests_to_run as $test ) {
504
				switch ( $test ) {
505
					// TEST #1 : check that section was set
506
					case 1 :
507
						if ( empty( $section ) ) {
508
							if ( $display_errors ) {
509
								throw new EE_Error(
510
									sprintf(
511
										__(
512
											'No configuration section has been provided while attempting to save "%s".',
513
											'event_espresso'
514
										),
515
										$config_class
516
									)
517
								);
518
							}
519
							return false;
520
						}
521
						break;
@@ 523-533 (lines=11) @@
520
						}
521
						break;
522
					// TEST #2 : check that settings section exists
523
					case 2 :
524
						if ( ! isset( $this->{$section} ) ) {
525
							if ( $display_errors ) {
526
								throw new EE_Error(
527
									sprintf(
528
										__( 'The "%s" configuration section does not exist.', 'event_espresso' ),
529
										$section
530
									)
531
								);
532
							}
533
							return false;
534
						}
535
						break;
536
					// TEST #3 : check that section is the proper format
@@ 556-565 (lines=10) @@
553
						}
554
						break;
555
					// TEST #4 : check that config section name has been set
556
					case 4 :
557
						if ( empty( $name ) ) {
558
							if ( $display_errors ) {
559
								throw new EE_Error(
560
									__(
561
										'No name has been provided for the specific configuration section.',
562
										'event_espresso'
563
									)
564
								);
565
							}
566
							return false;
567
						}
568
						break;
@@ 570-579 (lines=10) @@
567
						}
568
						break;
569
					// TEST #5 : check that a config class name has been set
570
					case 5 :
571
						if ( empty( $config_class ) ) {
572
							if ( $display_errors ) {
573
								throw new EE_Error(
574
									__(
575
										'No class name has been provided for the specific configuration section.',
576
										'event_espresso'
577
									)
578
								);
579
							}
580
							return false;
581
						}
582
						break;
@@ 584-596 (lines=13) @@
581
						}
582
						break;
583
					// TEST #6 : verify config class is accessible
584
					case 6 :
585
						if ( ! class_exists( $config_class ) ) {
586
							if ( $display_errors ) {
587
								throw new EE_Error(
588
									sprintf(
589
										__(
590
											'The "%s" class does not exist. Please ensure that an autoloader has been set for it.',
591
											'event_espresso'
592
										),
593
										$config_class
594
									)
595
								);
596
							}
597
							return false;
598
						}
599
						break;