Code Duplication    Length = 5-5 lines in 4 locations

core/helpers/EEH_Template_Validator.helper.php 1 location

@@ 168-172 (lines=5) @@
165
	 */
166
	static function verify_argument_is_one_of($variable_to_test,$variable_name,$string_options){
167
		if(!WP_DEBUG)return;
168
		if(!in_array($variable_to_test,$string_options)){
169
			$msg[0]=__('Malconfigured template.','event_espresso');
170
			$msg[1]=__("Variable named '%s' was set to '%s'. It can only be one of '%s'",'event_espresso');
171
			throw new EE_Error(sprintf(implode("||",$msg),$variable_name,$variable_to_test, implode("', '",$string_options)));
172
		}
173
	}
174
175

core/libraries/messages/validators/EE_Messages_Validator.core.php 1 location

@@ 377-381 (lines=5) @@
374
			if ( isset( $this->_validators[$field]['shortcodes'] ) && !empty( $this->_validators[$field]['shortcodes'] ) ) {
375
				$invalid_shortcodes = $this->_invalid_shortcodes( $value, $this->_validators[$field]['shortcodes'] );
376
				//if true then that means there is a returned error message that we'll need to add to the _errors array for this field.
377
				if ( $invalid_shortcodes ) {
378
					$v_s = array_keys($this->_validators[$field]['shortcodes']);
379
					$err_msg = sprintf( __('<p>The following shortcodes were found in the "%s" field that ARE not valid: %s</p>', 'event_espresso'), '<strong>' . $field_label . '</strong>', $invalid_shortcodes );
380
					$err_msg .= sprintf( __('<p>Valid shortcodes for this field are: %s', 'event_espresso'), implode(', ', $v_s ) );
381
				}
382
			}
383
384
			//if there's a "type" to be validated then let's do that too.

core/admin/EE_Admin_Page.core.php 2 locations

@@ 589-593 (lines=5) @@
586
			$classname = str_replace('.class.php', '', $page);
587
588
			//autoloaders should take care of loading file
589
			if ( !class_exists( $classname ) ) {
590
				$error_msg[] = sprintf( __('Something went wrong with loading the %s admin hooks page.', 'event_espresso' ), $page);
591
				$error_msg[] = $error_msg[0] . "\r\n" . sprintf( __( 'There is no class in place for the %s admin hooks page.%sMake sure you have <strong>%s</strong> defined. If this is a non-EE-core admin page then you also must have an autoloader in place for your class', 'event_espresso'), $page, '<br />', $classname );
592
				throw new EE_Error( implode( '||', $error_msg ));
593
			}
594
595
			$a = new ReflectionClass($classname);
596
@@ 1177-1181 (lines=5) @@
1174
					}
1175
1176
					require_once $file_path;
1177
					if ( !class_exists( $tour ) ) {
1178
						$error_msg[] = sprintf( __('Something went wrong with loading the %s Help Tour Class.', 'event_espresso' ), $tour);
1179
						$error_msg[] = $error_msg[0] . "\r\n" . sprintf( __( 'There is no class in place for the %s help tour.%s Make sure you have <strong>%s</strong> defined in the "help_tour" array for the %s route of the % admin page.', 'event_espresso'), $tour, '<br />', $tour, $this->_req_action, get_class($this) );
1180
						throw new EE_Error( implode( '||', $error_msg ));
1181
					}
1182
					$a = new ReflectionClass($tour);
1183
					$tour_obj = $a->newInstance($this->_is_caf);
1184