http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88101
Revision: 88101
Author: mkroetzsch
Date: 2011-05-14 16:07:23 +0000 (Sat, 14 May 2011)
Log Message:
-----------
minor fixes in documentation and layout
Modified Paths:
--------------
trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_GeoCoord.php
Modified:
trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_GeoCoord.php
===================================================================
--- trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_GeoCoord.php
2011-05-14 16:01:15 UTC (rev 88100)
+++ trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_GeoCoord.php
2011-05-14 16:07:23 UTC (rev 88101)
@@ -18,13 +18,12 @@
/**
* Constructor.
*
- * @param array $coords Array with lat and long keys pointing to float
values.
- * @param string $typeid
+ * @param $coords array Array with lat and long keys pointing to float
values.
+ * @param $typeid string
*/
public function __construct( array $coords, $typeid = '_geo' ) {
parent::__construct( $typeid );
-
- $this->coordinateSet = $coords;
+ $this->coordinateSet = $coords;
}
/**
@@ -36,7 +35,8 @@
}
/**
- * Returns the coordinate set as an array with lat and long keys
pointing to float values.
+ * Returns the coordinate set as an array with lat and long keys
+ * pointing to float values.
*
* @since 1.6
*
@@ -52,7 +52,7 @@
*/
public function getSortKey() {
return $this->coordinateSet['lat']; // TODO
- }
+ }
/**
* (non-PHPdoc)
@@ -67,15 +67,15 @@
* ID.
* @note PHP can convert any string to some number, so we do not do
* validation here (because this would require less efficient parsing).
- * @return SMWDINumber
+ * @return SMWDIGeoCoord
*/
public static function doUnserialize( $serialization, $typeid = '_geo'
) {
$parts = explode( ',', $serialization );
-
+
if ( count( $parts ) != 2 ) {
- throw new Exception( 'Unserialization of coordinates
failed' );
+ throw new SMWDataItemException( 'Unserialization of
coordinates failed' );
}
-
+
return new self( array( 'lat' => (float)$parts[0], 'lon' =>
(float)$parts[1], ), $typeid );
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs