Code Duplication    Length = 12-12 lines in 2 locations

classes/models/FrmInbox.php 2 locations

@@ 132-143 (lines=12) @@
129
	/**
130
	 * @param string $key
131
	 */
132
	public function mark_read( $key ) {
133
		if ( ! isset( $this->messages[ $key ] ) ) {
134
			return;
135
		}
136
137
		if ( ! isset( $this->messages[ $key ]['read'] ) ) {
138
			$this->messages[ $key ]['read'] = array();
139
		}
140
		$this->messages[ $key ]['read'][ get_current_user_id() ] = time();
141
142
		$this->update_list();
143
	}
144
145
	/**
146
	 * @param string $key
@@ 148-159 (lines=12) @@
145
	/**
146
	 * @param string $key
147
	 */
148
	public function dismiss( $key ) {
149
		if ( ! isset( $this->messages[ $key ] ) ) {
150
			return;
151
		}
152
153
		if ( ! isset( $this->messages[ $key ]['dismissed'] ) ) {
154
			$this->messages[ $key ]['dismissed'] = array();
155
		}
156
		$this->messages[ $key ]['dismissed'][ get_current_user_id() ] = time();
157
158
		$this->update_list();
159
	}
160
161
	private function update_list() {
162
		update_option( $this->option, $this->messages, 'no' );