Code Duplication    Length = 2-3 lines in 4 locations

projects/packages/post-images/src/class-post-images.php 2 locations

@@ 671-673 (lines=3) @@
668
		if ( $args['from_thumbnail'] ) {
669
			$media = self::from_thumbnail( $post_id, $args['width'], $args['height'] );
670
		}
671
		if ( ! $media && $args['from_slideshow'] ) {
672
			$media = self::from_slideshow( $post_id, $args['width'], $args['height'] );
673
		}
674
		if ( ! $media && $args['from_gallery'] ) {
675
			$media = self::from_gallery( $post_id );
676
		}
@@ 677-679 (lines=3) @@
674
		if ( ! $media && $args['from_gallery'] ) {
675
			$media = self::from_gallery( $post_id );
676
		}
677
		if ( ! $media && $args['from_attachment'] ) {
678
			$media = self::from_attachment( $post_id, $args['width'], $args['height'] );
679
		}
680
		if ( ! $media && $args['from_blocks'] ) {
681
			if ( empty( $args['html_content'] ) ) {
682
				// Use the post_id, which will load the content.

projects/plugins/jetpack/class.jetpack-post-images.php 2 locations

@@ 682-683 (lines=2) @@
679
		if ( $args['from_thumbnail'] ) {
680
			$media = self::from_thumbnail( $post_id, $args['width'], $args['height'] );
681
		}
682
		if ( ! $media && $args['from_slideshow'] ) {
683
			$media = self::from_slideshow( $post_id, $args['width'], $args['height'] );
684
		}
685
		if ( ! $media && $args['from_gallery'] ) {
686
			$media = self::from_gallery( $post_id );
@@ 688-689 (lines=2) @@
685
		if ( ! $media && $args['from_gallery'] ) {
686
			$media = self::from_gallery( $post_id );
687
		}
688
		if ( ! $media && $args['from_attachment'] ) {
689
			$media = self::from_attachment( $post_id, $args['width'], $args['height'] );
690
		}
691
		if ( ! $media && $args['from_blocks'] ) {
692
			if ( empty( $args['html_content'] ) ) {