Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 251-255 (lines=5) @@
248
				unset( $this->_active_messengers[$active_name] );
249
			}
250
		} else {
251
			foreach( $active_messengers as $messenger => $settings ) {
252
				if ( ! empty( $settings['settings'][$messenger . '-message_types'][$active_name] ) ) {
253
					unset( $active_messengers[$messenger]['settings'][$messenger . '-message_types'][$active_name] );
254
				}
255
			}
256
			EEH_MSG_Template::update_to_inactive( '', $active_name );
257
			if ( isset( $this->_active_message_types[$active_name] ) ) {
258
				unset( $this->_active_message_types[$active_name] );

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

@@ 146-150 (lines=5) @@
143
    	if ( !empty( self::$_ee_message_type_registry[$mt_name] ) ) {
144
                        //let's make sure that we remove any place this message type was made active
145
                        $active_messengers = EEH_MSG_Template::get_active_messengers_in_db();
146
                        foreach( $active_messengers as $messenger => $settings ) {
147
                            if ( !empty( $settings['settings'][$messenger . '-message_types'][$mt_name] ) ) {
148
                                unset( $active_messengers[$messenger]['settings'][$messenger . '-message_types'][$mt_name] );
149
                            }
150
                        }
151
                        EEH_MSG_Template::update_to_inactive( '', $mt_name );
152
                        EEH_MSG_Template::update_active_messengers_in_db( $active_messengers );
153
    		unset( self::$_ee_message_type_registry[$mt_name] );