Code Duplication    Length = 10-13 lines in 5 locations

core/EE_Config.core.php 5 locations

@@ 463-475 (lines=13) @@
460
				switch ( $test ) {
461
462
					// TEST #1 : check that section was set
463
					case 1 :
464
						if ( empty( $section ) ) {
465
							if ( $display_errors ) {
466
								throw new EE_Error(
467
									sprintf(
468
										__( 'No configuration section has been provided while attempting to save "%s".', 'event_espresso' ),
469
										$config_class
470
									)
471
								);
472
							}
473
							return false;
474
						}
475
						break;
476
477
					// TEST #2 : check that settings section exists
478
					case 2 :
@@ 478-488 (lines=11) @@
475
						break;
476
477
					// TEST #2 : check that settings section exists
478
					case 2 :
479
						if ( ! isset( $this->{$section} ) ) {
480
							if ( $display_errors ) {
481
								throw new EE_Error(
482
									sprintf( __( 'The "%s" configuration section does not exist.', 'event_espresso' ),
483
											 $section )
484
								);
485
							}
486
							return false;
487
						}
488
						break;
489
490
					// TEST #3 : check that section is the proper format
491
					case 3 :
@@ 508-517 (lines=10) @@
505
						break;
506
507
					// TEST #4 : check that config section name has been set
508
					case 4 :
509
						if ( empty( $name ) ) {
510
							if ( $display_errors ) {
511
								throw new EE_Error(
512
									__( 'No name has been provided for the specific configuration section.', 'event_espresso' )
513
								);
514
							}
515
							return false;
516
						}
517
						break;
518
519
					// TEST #5 : check that a config class name has been set
520
					case 5 :
@@ 520-529 (lines=10) @@
517
						break;
518
519
					// TEST #5 : check that a config class name has been set
520
					case 5 :
521
						if ( empty( $config_class ) ) {
522
							if ( $display_errors ) {
523
								throw new EE_Error(
524
									__( 'No class name has been provided for the specific configuration section.', 'event_espresso' )
525
								);
526
							}
527
							return false;
528
						}
529
						break;
530
531
					// TEST #6 : verify config class is accessible
532
					case 6 :
@@ 532-544 (lines=13) @@
529
						break;
530
531
					// TEST #6 : verify config class is accessible
532
					case 6 :
533
						if ( ! class_exists( $config_class ) ) {
534
							if ( $display_errors ) {
535
								throw new EE_Error(
536
									sprintf(
537
										__( 'The "%s" class does not exist. Please ensure that an autoloader has been set for it.', 'event_espresso' ),
538
										$config_class
539
									)
540
								);
541
							}
542
							return false;
543
						}
544
						break;
545
546
					// TEST #7 : check that config has even been set
547
					case 7 :