Typehint FormatMetadata::collapseContactInfO()

The method expects array, but was given a string.
Since there's only one caller, the caller is fixed
and the method typehinted.

Also fix doc comment

Bug: T257497
Change-Id: I67c337c4ee95ca30d968b89251dbbe077d2110e3
This commit is contained in:
Ammar Abdulhamid 2020-07-08 21:02:44 +01:00 committed by Umherirrender
parent 6fe47ee97f
commit a31b638245
2 changed files with 5 additions and 5 deletions

View file

@ -67,9 +67,9 @@ class ExifBitmapHandler extends BitmapHandler {
// ContactInfo also has to be dealt with specially
if ( isset( $metadata['Contact'] ) ) {
$metadata['Contact'] =
$formatter->collapseContactInfo(
$metadata['Contact'] );
$metadata['Contact'] = $formatter->collapseContactInfo(
is_array( $metadata['Contact'] ) ? $metadata['Contact'] : [ $metadata['Contact'] ]
);
}
foreach ( $metadata as &$val ) {

View file

@ -1453,7 +1453,7 @@ class FormatMetadata extends ContextSource {
* Format the contact info field into a single value.
*
* This function might be called from
* JpegHandler::convertMetadataVersion which is why it is
* ExifBitmapHandler::convertMetadataVersion which is why it is
* public.
*
* @param array $vals Array with fields of the ContactInfo
@ -1463,7 +1463,7 @@ class FormatMetadata extends ContextSource {
* @return string HTML-ish looking wikitext
* @since 1.23 no longer static
*/
public function collapseContactInfo( $vals ) {
public function collapseContactInfo( array $vals ) {
if ( !( isset( $vals['CiAdrExtadr'] )
|| isset( $vals['CiAdrCity'] )
|| isset( $vals['CiAdrCtry'] )