Code Duplication    Length = 6-12 lines in 3 locations

modules/videopress/class.videopress-cli.php 1 location

@@ 101-106 (lines=6) @@
98
99
			$time = $scheduler->check_cron( $args[0] );
100
101
			if ( ! $time ) {
102
				WP_CLI::success( __( 'The cron is not scheduled to run.', 'jetpack' ) );
103
104
			} else {
105
				WP_CLI::success( sprintf( __( 'Cron will run at: %s GMT', 'jetpack' ), gmdate( 'Y-m-d H:i:s', $time ) ) );
106
			}
107
		}
108
109
		/**

class.jetpack-cli.php 2 locations

@@ 273-282 (lines=10) @@
270
271
		$is_dry_run = ! empty( $assoc_args['dry-run'] );
272
273
		if ( $is_dry_run ) {
274
			WP_CLI::warning(
275
				__( "\nThis is a dry run.\n", 'jetpack' ) .
276
				__( "No actions will be taken.\n", 'jetpack' ) .
277
				__( "The following messages will give you preview of what will happen when you run this command.\n\n", 'jetpack' )
278
			);
279
		} else {
280
			// We only need to confirm "Are you sure?" when we are not doing a dry run.
281
			jetpack_cli_are_you_sure();
282
		}
283
284
		switch ( $action ) {
285
			case 'options':
@@ 966-977 (lines=12) @@
963
					} else {
964
						WP_CLI::log( __( 'Initialized a new full sync', 'jetpack' ) );
965
					}
966
				} else {
967
968
					// Reset sync settings to original.
969
					Jetpack_Sync_Settings::update_settings( $original_settings );
970
971
					if ( $modules ) {
972
						/* translators: %s is a comma separated list of Jetpack modules */
973
						WP_CLI::error( sprintf( __( 'Could not start a new full sync with modules: %s', 'jetpack' ), join( ', ', $modules ) ) );
974
					} else {
975
						WP_CLI::error( __( 'Could not start a new full sync', 'jetpack' ) );
976
					}
977
				}
978
979
				// Keep sending to WPCOM until there's nothing to send
980
				$i = 1;