Code Duplication    Length = 8-8 lines in 3 locations

includes/media/GIF.php 1 location

@@ 50-57 (lines=8) @@
47
	 * @param bool|IContextSource $context Context to use (optional)
48
	 * @return array|bool
49
	 */
50
	function formatMetadata( $image, $context = false ) {
51
		$meta = $this->getCommonMetaArray( $image );
52
		if ( count( $meta ) === 0 ) {
53
			return false;
54
		}
55
56
		return $this->formatMetadataHelper( $meta, $context );
57
	}
58
59
	/**
60
	 * Return the standard metadata elements for #filemetadata parser func.

includes/media/PNG.php 1 location

@@ 55-62 (lines=8) @@
52
	 * @param bool|IContextSource $context Context to use (optional)
53
	 * @return array|bool
54
	 */
55
	function formatMetadata( $image, $context = false ) {
56
		$meta = $this->getCommonMetaArray( $image );
57
		if ( count( $meta ) === 0 ) {
58
			return false;
59
		}
60
61
		return $this->formatMetadataHelper( $meta, $context );
62
	}
63
64
	/**
65
	 * Get a file type independent array of metadata.

includes/media/ExifBitmap.php 1 location

@@ 131-138 (lines=8) @@
128
	 * @param bool|IContextSource $context Context to use (optional)
129
	 * @return array|bool
130
	 */
131
	function formatMetadata( $image, $context = false ) {
132
		$meta = $this->getCommonMetaArray( $image );
133
		if ( count( $meta ) === 0 ) {
134
			return false;
135
		}
136
137
		return $this->formatMetadataHelper( $meta, $context );
138
	}
139
140
	public function getCommonMetaArray( File $file ) {
141
		$metadata = $file->getMetadata();