Code Duplication    Length = 17-17 lines in 2 locations

_inc/lib/core-api/wpcom-fields/attachment-fields-videopress.php 1 location

@@ 65-81 (lines=17) @@
62
	 *
63
	 * @return string
64
	 */
65
	public function get( $attachment, $request ) {
66
		if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
67
			$blog_id = get_current_blog_id();
68
		} else {
69
			$blog_id = Jetpack_Options::get_option( 'id' );
70
		}
71
72
		$post_id = absint( $attachment['id'] );
73
74
		$videopress_guid = $this->get_videopress_guid( $post_id, $blog_id );
75
76
		if ( ! $videopress_guid ) {
77
			return '';
78
		}
79
80
		return $videopress_guid;
81
	}
82
83
	/**
84
	 * Gets the VideoPress GUID for a given attachment.

_inc/lib/core-api/wpcom-fields/class-wpcom-rest-api-v2-attachment-videopress-data.php 1 location

@@ 65-81 (lines=17) @@
62
	 *
63
	 * @return string
64
	 */
65
	public function get( $attachment, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
66
		if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
67
			$blog_id = get_current_blog_id();
68
		} else {
69
			$blog_id = Jetpack_Options::get_option( 'id' );
70
		}
71
72
		$post_id = absint( $attachment['id'] );
73
74
		$videopress = $this->get_videopress_data( $post_id, $blog_id );
75
76
		if ( ! $videopress ) {
77
			return array();
78
		}
79
80
		return $videopress;
81
	}
82
83
	/**
84
	 * Gets the VideoPress GUID for a given attachment.