Code Duplication    Length = 15-15 lines in 2 locations

src/includes/batch-analysis/class-wordlift-batch-analysis-adapter.php 2 locations

@@ 156-170 (lines=15) @@
153
	 *
154
	 * @since 3.14.0
155
	 */
156
	public function cancel() {
157
158
		if ( ! isset( $_REQUEST['post'] ) ) {
159
			wp_die( 'The `post` parameter is required.' );
160
		}
161
162
		$count = $this->batch_analysis_service->cancel( (array) $_REQUEST['post'] );
163
164
		// Clear any buffer.
165
		ob_clean();
166
167
		// Send the response.
168
		wp_send_json_success( array( 'count' => $count ) );
169
170
	}
171
172
	/**
173
	 * Clear warnings for the specified post.
@@ 177-191 (lines=15) @@
174
	 *
175
	 * @since 3.14.0
176
	 */
177
	public function clear_warning() {
178
179
		if ( ! isset( $_REQUEST['post'] ) ) {
180
			wp_die( 'The `post` parameter is required.' );
181
		}
182
183
		$this->batch_analysis_service->clear_warning( (array) $_REQUEST['post'] );
184
185
		// Clear any buffer.
186
		ob_clean();
187
188
		// Send the response.
189
		wp_send_json_success();
190
191
	}
192
193
}
194