Code Duplication    Length = 3-4 lines in 2 locations

class.jetpack-cli.php 2 locations

@@ 268-271 (lines=4) @@
265
	 */
266
	public function reset( $args, $assoc_args ) {
267
		$action = isset( $args[0] ) ? $args[0] : 'prompt';
268
		if ( ! in_array( $action, array( 'options', 'modules', 'sync-checksum' ), true ) ) {
269
			/* translators: %s is a command like "prompt" */
270
			WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) );
271
		}
272
273
		$is_dry_run = ! empty( $assoc_args['dry-run'] );
274
@@ 702-704 (lines=3) @@
699
		// Is the option flagged as unsafe?
700
		$flagged = ! in_array( $args[1], $safe_to_modify );
701
702
		if ( ! in_array( $action, array( 'list', 'get', 'delete', 'update' ) ) ) {
703
			/* translators: %s is a command like "prompt" */
704
			WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) );
705
		}
706
707
		if ( isset( $args[0] ) ) {