Code Duplication    Length = 6-6 lines in 2 locations

json-endpoints/class.wpcom-json-api-edit-media-v1-2-endpoint.php 1 location

@@ 362-367 (lines=6) @@
359
360
			$has_original_media = Jetpack_Media::get_original_media( $media_id );
361
362
			if ( ! $has_original_media ) {
363
				// The first time that the media is updated
364
				// the original media is stored into the revision_history
365
				$snapshot = $this->get_snapshot( $media_item );
366
				add_post_meta( $media_id, Jetpack_Media::$WP_ORIGINAL_MEDIA, $snapshot, true );
367
			}
368
369
			// save the temporal file locally
370
			$temporal_file = $media_file ? $media_file : $this->build_file_array_from_url( $media_id, $media_url );

_inc/lib/class.media.php 1 location

@@ 411-416 (lines=6) @@
408
		$media_item         = get_post( $media_id );
409
		$has_original_media = self::get_original_media( $media_id );
410
411
		if ( ! $has_original_media ) {
412
413
			// The first time that the media is updated
414
			// the original media is stored into the revision_history.
415
			$snapshot = self::get_snapshot( $media_item );
416
			//phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
417
			add_post_meta( $media_id, self::$WP_ORIGINAL_MEDIA, $snapshot, true );
418
		}
419