Jeroen De Dauw has submitted this change and it was merged. Change subject: Remove usage of ValueFormatters Result interface ......................................................................
Remove usage of ValueFormatters Result interface Change-Id: Ie789713a4633978043ac6bc2eb3e2bfd7e6b345d --- M includes/Geocoders.php M includes/parserhooks/Maps_Coordinates.php M includes/parserhooks/Maps_Finddestination.php M includes/parserhooks/Maps_Geocode.php 4 files changed, 4 insertions(+), 13 deletions(-) Approvals: Jeroen De Dauw: Verified; Looks good to me, approved diff --git a/includes/Geocoders.php b/includes/Geocoders.php index eb3e69f..e8f3390 100644 --- a/includes/Geocoders.php +++ b/includes/Geocoders.php @@ -185,10 +185,7 @@ ) ); $formatter = new \ValueFormatters\GeoCoordinateFormatter( $options ); - - $formattingResult = $formatter->format( $geoCoordinate ); - - return $formattingResult->isValid() ? $formattingResult->getValue() : false; + return $formatter->format( $geoCoordinate ); } /** diff --git a/includes/parserhooks/Maps_Coordinates.php b/includes/parserhooks/Maps_Coordinates.php index f011777..3e1c38b 100644 --- a/includes/parserhooks/Maps_Coordinates.php +++ b/includes/parserhooks/Maps_Coordinates.php @@ -96,7 +96,7 @@ $coordinateFormatter = new \ValueFormatters\GeoCoordinateFormatter( $options ); - $output = $coordinateFormatter->format( $parameters['location'] )->getValue(); + $output = $coordinateFormatter->format( $parameters['location'] ); return $output; } diff --git a/includes/parserhooks/Maps_Finddestination.php b/includes/parserhooks/Maps_Finddestination.php index 84a811c..534b871 100644 --- a/includes/parserhooks/Maps_Finddestination.php +++ b/includes/parserhooks/Maps_Finddestination.php @@ -134,7 +134,7 @@ $formatter = new \ValueFormatters\GeoCoordinateFormatter( $options ); $geoCoords = new \DataValues\GeoCoordinateValue( $destination['lat'], $destination['lon'] ); - $output = $formatter->format( $geoCoords )->getValue(); + $output = $formatter->format( $geoCoords ); return $output; } diff --git a/includes/parserhooks/Maps_Geocode.php b/includes/parserhooks/Maps_Geocode.php index 27ca1ee..3c0d2c4 100644 --- a/includes/parserhooks/Maps_Geocode.php +++ b/includes/parserhooks/Maps_Geocode.php @@ -121,13 +121,7 @@ $formatter = new \ValueFormatters\GeoCoordinateFormatter( $options ); - $result = $formatter->format( $coordinates ); - - if ( !$result->isValid() ) { - throw new MWException( 'Could not format the coordinates' ); - } - - return $result->getValue(); + return $formatter->format( $coordinates ); } /** -- To view, visit https://gerrit.wikimedia.org/r/58883 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie789713a4633978043ac6bc2eb3e2bfd7e6b345d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Maps Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com> Gerrit-Reviewer: Jeroen De Dauw <jeroended...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits