Code Duplication    Length = 13-14 lines in 2 locations

admin_pages/messages/Messages_Admin_Page.core.php 2 locations

@@ 117-130 (lines=14) @@
114
	 * @return array
115
	 * @throws \EE_Error
116
	 */
117
	public function get_messengers_for_list_table() {
118
		$m_values = array();
119
		$active_messengers = EEM_Message::instance()->get_all( array( 'group_by' => 'MSG_messenger' ) );
120
		//setup messengers for selects
121
		$i = 1;
122
		foreach ( $active_messengers as $active_messenger ) {
123
			if ( $active_messenger instanceof EE_Message ) {
124
				$m_values[ $i ]['id'] = $active_messenger->messenger();
125
				$m_values[ $i ]['text'] = ucwords( $active_messenger->messenger_label() );
126
				$i++;
127
			}
128
		}
129
		return $m_values;
130
	}
131
132
133
@@ 140-152 (lines=13) @@
137
	 * @return array
138
	 * @throws \EE_Error
139
	 */
140
	public function get_message_types_for_list_table() {
141
		$mt_values = array();
142
		$active_messages = EEM_Message::instance()->get_all( array( 'group_by' => 'MSG_message_type' ) );
143
		$i = 1;
144
		foreach ( $active_messages as $active_message ) {
145
			if ( $active_message instanceof EE_Message ) {
146
				$mt_values[ $i ]['id'] = $active_message->message_type();
147
				$mt_values[ $i ]['text'] = ucwords( $active_message->message_type_label() );
148
				$i++;
149
			}
150
		}
151
		return $mt_values;
152
	}
153
154
155