Code Duplication    Length = 10-13 lines in 5 locations

core/EE_Config.core.php 5 locations

@@ 480-492 (lines=13) @@
477
			foreach ( $tests_to_run as $test ) {
478
				switch ( $test ) {
479
					// TEST #1 : check that section was set
480
					case 1 :
481
						if ( empty( $section ) ) {
482
							if ( $display_errors ) {
483
								throw new EE_Error(
484
									sprintf(
485
										__(
486
											'No configuration section has been provided while attempting to save "%s".',
487
											'event_espresso'
488
										),
489
										$config_class
490
									)
491
								);
492
							}
493
							return false;
494
						}
495
						break;
@@ 497-507 (lines=11) @@
494
						}
495
						break;
496
					// TEST #2 : check that settings section exists
497
					case 2 :
498
						if ( ! isset( $this->{$section} ) ) {
499
							if ( $display_errors ) {
500
								throw new EE_Error(
501
									sprintf(
502
										__( 'The "%s" configuration section does not exist.', 'event_espresso' ),
503
										$section
504
									)
505
								);
506
							}
507
							return false;
508
						}
509
						break;
510
					// TEST #3 : check that section is the proper format
@@ 530-539 (lines=10) @@
527
						}
528
						break;
529
					// TEST #4 : check that config section name has been set
530
					case 4 :
531
						if ( empty( $name ) ) {
532
							if ( $display_errors ) {
533
								throw new EE_Error(
534
									__(
535
										'No name has been provided for the specific configuration section.',
536
										'event_espresso'
537
									)
538
								);
539
							}
540
							return false;
541
						}
542
						break;
@@ 544-553 (lines=10) @@
541
						}
542
						break;
543
					// TEST #5 : check that a config class name has been set
544
					case 5 :
545
						if ( empty( $config_class ) ) {
546
							if ( $display_errors ) {
547
								throw new EE_Error(
548
									__(
549
										'No class name has been provided for the specific configuration section.',
550
										'event_espresso'
551
									)
552
								);
553
							}
554
							return false;
555
						}
556
						break;
@@ 558-570 (lines=13) @@
555
						}
556
						break;
557
					// TEST #6 : verify config class is accessible
558
					case 6 :
559
						if ( ! class_exists( $config_class ) ) {
560
							if ( $display_errors ) {
561
								throw new EE_Error(
562
									sprintf(
563
										__(
564
											'The "%s" class does not exist. Please ensure that an autoloader has been set for it.',
565
											'event_espresso'
566
										),
567
										$config_class
568
									)
569
								);
570
							}
571
							return false;
572
						}
573
						break;