Code Duplication    Length = 4-10 lines in 5 locations

modules/single_page_checkout/inc/EE_Checkout.class.php 1 location

@@ 598-606 (lines=9) @@
595
			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
596
			// set the start time for this reg step
597
			if ( ! $transaction_processor->set_reg_step_initiated( $this->transaction, $reg_step->slug() ) ) {
598
				if ( WP_DEBUG ) {
599
					EE_Error::add_error(
600
						sprintf(
601
							__( 'The "%1$s" registration step was not initialized properly.', 'event_espresso' ),
602
							$reg_step->name()
603
						),
604
						__FILE__, __FUNCTION__, __LINE__
605
					);
606
				}
607
			};
608
		}
609
	}

core/helpers/EEH_Activation.helper.php 1 location

@@ 818-827 (lines=10) @@
815
			$current_data_migration_script->set_migrating( false );
816
			$current_data_migration_script->schema_changes_before_migration();
817
			$current_data_migration_script->schema_changes_after_migration();
818
			if( $current_data_migration_script->get_errors() ){
819
				if( WP_DEBUG ){
820
					foreach( $current_data_migration_script->get_errors() as $error ){
821
						EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__ );
822
					}
823
				}else{
824
					EE_Error::add_error( __( 'There were errors creating the Event Espresso database tables and Event Espresso has been deactivated. To view the errors, please enable WP_DEBUG in your wp-config.php file.', 'event_espresso' ) );
825
				}
826
				return false;
827
			}
828
			EE_Data_Migration_Manager::instance()->update_current_database_state_to();
829
		}else{
830
			EE_Error::add_error( __( 'Could not determine most up-to-date data migration script from which to pull database schema structure. So database is probably not setup properly', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);

core/db_models/EEM_Base.model.php 1 location

@@ 4392-4397 (lines=6) @@
4389
	 * @return array
4390
	 */
4391
	public function get_IDs( $model_objects, $filter_out_empty_ids = false) {
4392
		if( ! $this->has_primary_key_field() ) {
4393
			if( WP_DEBUG ) {
4394
				EE_Error::add_error( __( 'Trying to get IDs from a model than has no primary key', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
4395
				return array();
4396
			}
4397
		}
4398
		$IDs = array();
4399
		foreach( $model_objects as $model_object ) {
4400
			$id = $model_object->ID();

core/libraries/messages/EE_messages.lib.php 2 locations

@@ 388-391 (lines=4) @@
385
					return $send_messages;
386
				}
387
			}
388
		} else {
389
			EE_Error::add_error( sprintf( __('Message type: %s does not exist', 'event_espresso'), $type ), __FILE__, __FUNCTION__, __LINE__ );
390
			return false;
391
		}
392
		// add a success message
393
		if ( ! $error ) {
394
			EE_Error::add_success( sprintf( __( 'The %s message has been successfully sent.', 'event_espresso'), $installed_message_types[$type]->label['singular'] ), __FILE__, __FUNCTION__, __LINE__ );
@@ 438-441 (lines=4) @@
435
				return FALSE;
436
			}
437
438
		} else {
439
			EE_Error::add_error( sprintf( __('Message type: %s does not exist', 'event_espresso'), $type ), __FILE__, __FUNCTION__, __LINE__ );
440
			return FALSE;
441
		}
442
443
	}
444