r88950 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88949‎ | r88950 | r88951 >
Date:23:22, 26 May 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added 2 new factory methods
Modified paths:
  • /trunk/extensions/Maps/includes/Maps_Location.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/Maps_Location.php
@@ -91,8 +91,36 @@
9292 */
9393 protected $separator;
9494
 95+ /**
 96+ * Creates and returns a new instance of a MapsLocation from a latitude and longitude.
 97+ *
 98+ * @since 1.0
 99+ *
 100+ * @param float $lat
 101+ * @param float $lon
 102+ * @param integer $format
 103+ *
 104+ * @return MapsLocation
 105+ */
 106+ public static function newFromLatLon( $lat, $lon, $format = Maps_COORDS_FLOAT ) {
 107+ return new self( $lat . ',' . $lon, $format );
 108+ }
95109
96110 /**
 111+ * Creates and returns a new instance of a MapsLocation from an address.
 112+ *
 113+ * @since 1.0
 114+ *
 115+ * @param string $address
 116+ * @param integer $format
 117+ *
 118+ * @return MapsLocation
 119+ */
 120+ public static function newFromAddress( $address, $format = Maps_COORDS_FLOAT ) {
 121+ return new self( $address, $format );
 122+ }
 123+
 124+ /**
97125 * Constructor.
98126 *
99127 * @param mixed $coordsOrAddress string or array with lat and lon

Status & tagging log