Code Duplication    Length = 14-14 lines in 2 locations

includes/media/GIF.php 1 location

@@ 64-77 (lines=14) @@
61
	 * @param File $image
62
	 * @return array|bool
63
	 */
64
	public function getCommonMetaArray( File $image ) {
65
		$meta = $image->getMetadata();
66
67
		if ( !$meta ) {
68
			return [];
69
		}
70
		$meta = unserialize( $meta );
71
		if ( !isset( $meta['metadata'] ) ) {
72
			return [];
73
		}
74
		unset( $meta['metadata']['_MW_GIF_VERSION'] );
75
76
		return $meta['metadata'];
77
	}
78
79
	/**
80
	 * @todo Add unit tests

includes/media/PNG.php 1 location

@@ 70-83 (lines=14) @@
67
	 * @param File $image
68
	 * @return array The metadata array
69
	 */
70
	public function getCommonMetaArray( File $image ) {
71
		$meta = $image->getMetadata();
72
73
		if ( !$meta ) {
74
			return [];
75
		}
76
		$meta = unserialize( $meta );
77
		if ( !isset( $meta['metadata'] ) ) {
78
			return [];
79
		}
80
		unset( $meta['metadata']['_MW_PNG_VERSION'] );
81
82
		return $meta['metadata'];
83
	}
84
85
	/**
86
	 * @param File $image