jenkins-bot has submitted this change and it was merged. Change subject: (bug 53391) allow lat/lon values from -360 to 360, possible for non-earth globes ......................................................................
(bug 53391) allow lat/lon values from -360 to 360, possible for non-earth globes Change-Id: I94ffc43cf66b06a8f870281fdb565029a6f60692 --- M DataValues/src/LatLongValue.php M DataValues/tests/phpunit/LatLongValueTest.php 2 files changed, 7 insertions(+), 7 deletions(-) Approvals: Tobias Gritschacher: Looks good to me, but someone else must approve Denny Vrandecic: Looks good to me, approved jenkins-bot: Verified diff --git a/DataValues/src/LatLongValue.php b/DataValues/src/LatLongValue.php index 68216c6..b1364db 100644 --- a/DataValues/src/LatLongValue.php +++ b/DataValues/src/LatLongValue.php @@ -68,8 +68,8 @@ throw new InvalidArgumentException( 'Can only construct LatLongValue with a numeric latitude' ); } - if ( $latitude < -90 || $latitude > 90 ) { - throw new OutOfRangeException( 'Latitude needs to be between -90 and 90' ); + if ( $latitude < -360 || $latitude > 360 ) { + throw new OutOfRangeException( 'Latitude needs to be between -360 and 360' ); } } @@ -78,8 +78,8 @@ throw new InvalidArgumentException( 'Can only construct LatLongValue with a numeric longitude' ); } - if ( $longitude < -180 || $longitude > 180 ) { - throw new OutOfRangeException( 'Longitude needs to be between -180 and 180' ); + if ( $longitude < -360 || $longitude > 360 ) { + throw new OutOfRangeException( 'Longitude needs to be between -360 and 360' ); } } diff --git a/DataValues/tests/phpunit/LatLongValueTest.php b/DataValues/tests/phpunit/LatLongValueTest.php index 1e5d7bc..30ffb07 100644 --- a/DataValues/tests/phpunit/LatLongValueTest.php +++ b/DataValues/tests/phpunit/LatLongValueTest.php @@ -75,10 +75,10 @@ $argLists[] = array( 42, '42' ); $argLists[] = array( '0', 0 ); - $argLists[] = array( -91, 0 ); + $argLists[] = array( -361, 0 ); $argLists[] = array( -999, 1 ); - $argLists[] = array( 90.001, 2 ); - $argLists[] = array( 3, 181 ); + $argLists[] = array( 360.001, 2 ); + $argLists[] = array( 3, 381 ); $argLists[] = array( 4, -1337 ); return $argLists; -- To view, visit https://gerrit.wikimedia.org/r/81195 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94ffc43cf66b06a8f870281fdb565029a6f60692 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: mw1.22-wmf14 Gerrit-Owner: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Denny Vrandecic <denny.vrande...@wikimedia.de> Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits