Code Duplication    Length = 3-12 lines in 4 locations

core/db_models/EEM_Base.model.php 2 locations

@@ 2977-2979 (lines=3) @@
2974
				'minimum',
2975
				'none'
2976
			);
2977
		if( ! in_array($use_default_where_conditions,$allowed_used_default_where_conditions_values)){
2978
			throw new EE_Error(sprintf(__("You passed an invalid value to the query parameter 'default_where_conditions' of '%s'. Allowed values are %s", "event_espresso"),$use_default_where_conditions,implode(", ",$allowed_used_default_where_conditions_values)));
2979
		}
2980
		$universal_query_params = array();
2981
		if( $use_default_where_conditions === 'all' || $use_default_where_conditions === 'this_model_only' ){
2982
			$universal_query_params = $this->_get_default_where_conditions();
@@ 4868-4879 (lines=12) @@
4865
	 */
4866
	static public function verify_is_valid_cap_context( $context ) {
4867
		$valid_cap_contexts = EEM_Base::valid_cap_contexts();
4868
		if( in_array( $context, $valid_cap_contexts ) ) {
4869
			return true;
4870
		}else{
4871
			throw new EE_Error(
4872
				sprintf(
4873
					__( 'Context "%1$s" passed into model "%2$s" is not a valid context. They are: %3$s', 'event_espresso' ),
4874
					$context,
4875
					'EEM_Base' ,
4876
					implode(',', $valid_cap_contexts )
4877
				)
4878
			);
4879
		}
4880
	}
4881
4882
	/**

core/EE_Registry.core.php 1 location

@@ 505-515 (lines=11) @@
502
		// don't give up! you gotta...
503
		try {
504
			//does the file exist and can it be read ?
505
			if ( ! $path ) {
506
				// so sorry, can't find the file
507
				throw new EE_Error (
508
					sprintf (
509
						__('The %1$s file %2$s could not be located or is not readable due to file permissions. Please ensure that the following filepath(s) are correct: %3$s','event_espresso'),
510
						trim( $type, '.' ),
511
						$class_name,
512
						'<br />' . implode( ',<br />', $file_paths )
513
					)
514
				);
515
			}
516
			// get the file
517
			require_once( $path );
518
			// if the class isn't already declared somewhere

core/libraries/messages/EE_messages.lib.php 1 location

@@ 113-115 (lines=3) @@
110
111
		$msgr = $messengers[$messenger];
112
		$valid_message_types = $msgr->get_valid_message_types();
113
		if ( ! in_array( $message_type, $valid_message_types ) ) {
114
			throw new EE_Error( sprint_f( __('The message type ($1%s) sent to $2%s is not valid for the $3%s messenger.  Doublecheck the spelling and verify that message type has been registered as a valid type with the messenger.', 'event_espresso' ), $message_type, __METHOD__, $messenger ) );
115
		}
116
117
		//all is good so let's just get it active
118
		return $this->activate_messenger( $messenger, array( $message_type ) );