Code Duplication    Length = 10-13 lines in 5 locations

core/EE_Config.core.php 5 locations

@@ 491-503 (lines=13) @@
488
			foreach ( $tests_to_run as $test ) {
489
				switch ( $test ) {
490
					// TEST #1 : check that section was set
491
					case 1 :
492
						if ( empty( $section ) ) {
493
							if ( $display_errors ) {
494
								throw new EE_Error(
495
									sprintf(
496
										__(
497
											'No configuration section has been provided while attempting to save "%s".',
498
											'event_espresso'
499
										),
500
										$config_class
501
									)
502
								);
503
							}
504
							return false;
505
						}
506
						break;
@@ 508-518 (lines=11) @@
505
						}
506
						break;
507
					// TEST #2 : check that settings section exists
508
					case 2 :
509
						if ( ! isset( $this->{$section} ) ) {
510
							if ( $display_errors ) {
511
								throw new EE_Error(
512
									sprintf(
513
										__( 'The "%s" configuration section does not exist.', 'event_espresso' ),
514
										$section
515
									)
516
								);
517
							}
518
							return false;
519
						}
520
						break;
521
					// TEST #3 : check that section is the proper format
@@ 541-550 (lines=10) @@
538
						}
539
						break;
540
					// TEST #4 : check that config section name has been set
541
					case 4 :
542
						if ( empty( $name ) ) {
543
							if ( $display_errors ) {
544
								throw new EE_Error(
545
									__(
546
										'No name has been provided for the specific configuration section.',
547
										'event_espresso'
548
									)
549
								);
550
							}
551
							return false;
552
						}
553
						break;
@@ 555-564 (lines=10) @@
552
						}
553
						break;
554
					// TEST #5 : check that a config class name has been set
555
					case 5 :
556
						if ( empty( $config_class ) ) {
557
							if ( $display_errors ) {
558
								throw new EE_Error(
559
									__(
560
										'No class name has been provided for the specific configuration section.',
561
										'event_espresso'
562
									)
563
								);
564
							}
565
							return false;
566
						}
567
						break;
@@ 569-581 (lines=13) @@
566
						}
567
						break;
568
					// TEST #6 : verify config class is accessible
569
					case 6 :
570
						if ( ! class_exists( $config_class ) ) {
571
							if ( $display_errors ) {
572
								throw new EE_Error(
573
									sprintf(
574
										__(
575
											'The "%s" class does not exist. Please ensure that an autoloader has been set for it.',
576
											'event_espresso'
577
										),
578
										$config_class
579
									)
580
								);
581
							}
582
							return false;
583
						}
584
						break;