r69121 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69120‎ | r69121 | r69122 >
Date:00:06, 7 July 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added docs
Modified paths:
  • /trunk/extensions/SemanticMaps/GeoCoords/SM_AreaValueDescription.php (modified) (history)
  • /trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValueDescription.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValueDescription.php
@@ -18,11 +18,17 @@
1919 *
2020 * @author Jeroen De Dauw
2121 *
 22+ * @since 0.6
 23+ *
2224 * @ingroup SemanticMaps
2325 */
2426 class SMGeoCoordsValueDescription extends SMWValueDescription {
2527
2628 /**
 29+ * Constructor.
 30+ *
 31+ * @since 0.6
 32+ *
2733 * @param SMGeoCoordsValue $dataValue
2834 */
2935 public function __construct( SMGeoCoordsValue $dataValue, $comparator ) {
@@ -32,6 +38,8 @@
3339 /**
3440 * @see SMWDescription::getQueryString
3541 *
 42+ * @since 0.6
 43+ *
3644 * @param Boolean $asvalue
3745 */
3846 public function getQueryString( $asValue = false ) {
@@ -46,6 +54,8 @@
4755 /**
4856 * @see SMWDescription::getSQLCondition
4957 *
 58+ * @since 0.6
 59+ *
5060 * @param string $tableName
5161 * @param array $fieldNames
5262 * @param DatabaseBase or Database $dbs
Index: trunk/extensions/SemanticMaps/GeoCoords/SM_AreaValueDescription.php
@@ -22,11 +22,22 @@
2323 *
2424 * TODO: would be awesome to use Spatial Extensions to select coordinates
2525 *
 26+ * @since 0.6
 27+ *
2628 * @ingroup SemanticMaps
2729 */
2830 class SMAreaValueDescription extends SMWValueDescription {
2931 protected $mBounds = false;
3032
 33+ /**
 34+ * Constructor.
 35+ *
 36+ * @since 0.6
 37+ *
 38+ * @param SMGeoCoordsValue $dataValue
 39+ * @param string $comparator
 40+ * @param string $radius
 41+ */
3142 public function __construct( SMGeoCoordsValue $dataValue, $comparator, $radius ) {
3243 parent::__construct( $dataValue, $comparator );
3344
@@ -39,6 +50,8 @@
4051 /**
4152 * Sets the mBounds fields to an array returned by SMAreaValueDescription::getBoundingBox.
4253 *
 54+ * @since 0.6
 55+ *
4356 * @param SMGeoCoordsValue $dataValue
4457 * @param string $radius
4558 */
@@ -52,6 +65,8 @@
5366 /**
5467 * @see SMWDescription:getQueryString
5568 *
 69+ * @since 0.6
 70+ *
5671 * @param Boolean $asvalue
5772 */
5873 public function getQueryString( $asValue = false ) {
@@ -65,12 +80,16 @@
6681
6782 /**
6883 * @see SMWDescription:prune
 84+ *
 85+ * @since 0.6
6986 */
7087 public function prune( &$maxsize, &$maxdepth, &$log ) {
7188 if ( ( $maxsize < $this->getSize() ) || ( $maxdepth < $this->getDepth() ) ) {
7289 $log[] = $this->getQueryString();
 90+
7391 $result = new SMWThingDescription();
7492 $result->setPrintRequests( $this->getPrintRequests() );
 93+
7594 return $result;
7695 } else {
7796 $maxsize = $maxsize - $this->getSize();
@@ -81,6 +100,10 @@
82101
83102 /**
84103 * Returns the bounds of the area.
 104+ *
 105+ * @since 0.6
 106+ *
 107+ * @return array
85108 */
86109 public function getBounds() {
87110 return $this->mBounds;
@@ -89,11 +112,13 @@
90113 /**
91114 * @see SMWDescription::getSQLCondition
92115 *
 116+ * @since 0.6
 117+ *
93118 * @param string $tableName
94119 * @param array $fieldNames
95120 * @param DatabaseBase or Database $dbs
96121 *
97 - * @return true
 122+ * @return string or false
98123 */
99124 public function getSQLCondition( $tableName, array $fieldNames, $dbs ) {
100125 global $smgUseSpatialExtensions;
@@ -140,6 +165,8 @@
141166 /**
142167 * Returns the lat and lon limits of a bounding box around a circle defined by the provided parameters.
143168 *
 169+ * @since 0.6
 170+ *
144171 * @param array $centerCoordinates Array containing non-directional float coordinates with lat and lon keys.
145172 * @param float $circleRadius The radidus of the circle to create a bounding box for, in m.
146173 *
@@ -161,8 +188,13 @@
162189
163190 /**
164191 * Returns a boolean indicating if MapsGeoFunctions is available.
 192+ *
 193+ * @since 0.6
 194+ *
 195+ * @return boolean
165196 */
166197 protected static function geoFunctionsAreAvailable() {
167198 return class_exists( 'MapsGeoFunctions' );
168199 }
 200+
169201 }
\ No newline at end of file

Status & tagging log