Code Duplication    Length = 4-8 lines in 4 locations

core/EE_Module_Request_Router.core.php 1 location

@@ 186-189 (lines=4) @@
183
	 * @return    EED_Module | NULL
184
	 */
185
	public static function module_factory( $module_name ) {
186
		if ( $module_name == 'EED_Module' ) {
187
			EE_Error::add_error( sprintf( __( 'EED_Module is an abstract parent class an can not be instantiated. Please provide a proper module name.', 'event_espresso' ), $module_name ), __FILE__, __FUNCTION__, __LINE__ );
188
			return NULL;
189
		}
190
		// let's pause to reflect on this...
191
		$mod_reflector = new ReflectionClass( $module_name );
192
		// ensure that class is actually a module

core/libraries/plugin_api/EE_Register_Messages_Template_Pack.lib.php 1 location

@@ 166-169 (lines=4) @@
163
164
		//loop through the existing registry and see if the classname is already present.
165
		foreach ( self::$_registry as $ref => $args ) {
166
			if ( $args['classname'] == $classname ) {
167
				EE_Error::add_error( sprintf( __('The %s template pack that you just activated cannot be registered with the messages system because there is already a template pack active using the same classname.  Contact the author of this template pack to let them know of the conflict.  To stop seeing this message you will need to deactivate this template pack.', 'event_espresso' ), (string) $setup_args['classname'] ), __FILE__, __LINE__, __FUNCTION__ );
168
				return false;
169
			}
170
		}
171
		return true;
172
	}

core/helpers/EEH_Activation.helper.php 2 locations

@@ 392-396 (lines=5) @@
389
				if ( $critical_page['post'] == NULL ) {
390
					$critical_page = EEH_Activation::create_critical_page( $critical_page );
391
					// REALLY? Still nothing ??!?!?
392
					if ( $critical_page['post'] == NULL ) {
393
						$msg = __( 'The Event Espresso critical page configuration settings could not be updated.', 'event_espresso' );
394
						EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
395
						break;
396
					}
397
				}
398
			}
399
			// track post_shortcodes
@@ 514-521 (lines=8) @@
511
	 */
512
	private static function _track_critical_page_post_shortcodes( $critical_page = array() ) {
513
		// check the goods
514
		if ( ! $critical_page['post'] instanceof WP_Post ) {
515
			$msg = sprintf(
516
				__( 'The Event Espresso critical page shortcode for the page %s can not be tracked because it is not a WP_Post object.', 'event_espresso' ),
517
				$critical_page['name']
518
			);
519
			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
520
			return;
521
		}
522
		$EE_Core_Config = EE_Registry::instance()->CFG->core;
523
		// map shortcode to post
524
		$EE_Core_Config->post_shortcodes[ $critical_page['post']->post_name ][ $critical_page['code'] ] = $critical_page['post']->ID;