Code Duplication    Length = 10-13 lines in 5 locations

core/EE_Config.core.php 5 locations

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