r107700 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107699‎ | r107700 | r107701 >
Date:03:46, 31 December 2011
Author:jeroendedauw
Status:ok (Comments)
Tags:
Comment:
dcos++
Modified paths:
  • /trunk/extensions/Maps/Maps.hooks.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_CoordinateParser.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_DistanceParser.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_GeoFunctions.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_Geocoder.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_Geocoders.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_KMLFormatter.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_Layer.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_LayerPage.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_Layers.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_Location.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_Mapper.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_MappingService.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_MappingServices.php (modified) (history)
  • /trunk/extensions/Maps/includes/Maps_Settings.php (modified) (history)
  • /trunk/extensions/Maps/includes/ext.maps.coord.js (modified) (history)
  • /trunk/extensions/Maps/includes/iMappingService.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/ext.maps.coord.js
@@ -33,7 +33,7 @@
3434 coords = coords.split( this.DELIMITER );
3535 for ( i in coords ) coords[i] = coords[i].trim();
3636 return coords;
37 - }
 37+ };
3838
3939 /**
4040 * Returns the provided coordinates joined in a string.
@@ -42,7 +42,7 @@
4343 */
4444 this.join = function( coords ) {
4545 return coords.join( this.DELIMITER + ' ' );
46 - }
 46+ };
4747
4848 /**
4949 * Returns a string with the directional DMS representatation of the provided latitude and longitude.
Index: trunk/extensions/Maps/includes/Maps_LayerPage.php
@@ -7,9 +7,10 @@
88 *
99 * @file Maps_LayerPage.php
1010 * @ingroup Maps
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1114 *
12 - * @author Jeroen De Dauw
13 - *
1415 * TODO: check for the page being not created yet (then it's not invalid if there is nothing there...)
1516 */
1617 class MapsLayerPage extends Article {
Index: trunk/extensions/Maps/includes/Maps_Geocoders.php
@@ -7,13 +7,14 @@
88 *
99 * @file Maps_Geocoders.php
1010 * @ingroup Maps
11 - *
12 - * @author Jeroen De Dauw
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 final class MapsGeocoders {
1516
1617 /**
17 - * Accociative with geoservice identifiers as keys containing instances of
 18+ * Associative with geoservice identifiers as keys containing instances of
1819 * the geocoder classes.
1920 *
2021 * Note: This list only contains the instances, so is not to be used for
@@ -27,9 +28,9 @@
2829 protected static $geocoders = array();
2930
3031 /**
31 - * Accociative with geoservice identifiers as keys containing the class
 32+ * Associative with geoservice identifiers as keys containing the class
3233 * name of the geocoders. This is used for registration of a geocoder
33 - * without immedialty instantiating it.
 34+ * without immediately instantiating it.
3435 *
3536 * @since 0.7
3637 *
@@ -105,7 +106,7 @@
106107 }
107108
108109 /**
109 - * This function first determines wether the provided string is a pair or coordinates
 110+ * This function first determines wether the provided string is a pair or coordinates
110111 * or an address. If it's the later, an attempt to geocode will be made. The function will
111112 * return the coordinates or false, in case a geocoding attempt was made but failed.
112113 *
@@ -113,10 +114,9 @@
114115 *
115116 * @param string $coordsOrAddress
116117 * @param string $geoservice
117 - * @param string $mappingService
 118+ * @param string|false $mappingService
118119 * @param boolean $checkForCoords
119 - * @param boolean $checkForCoords
120 - *
 120+ *
121121 * @return array or false
122122 */
123123 public static function attemptToGeocode( $coordsOrAddress, $geoservice = '', $mappingService = false, $checkForCoords = true ) {
@@ -137,6 +137,8 @@
138138 * @since 0.7
139139 *
140140 * @param string $coordsOrAddress
 141+ * @param string $geoService
 142+ * @param string|false $mappingService
141143 *
142144 * @return boolean
143145 */
@@ -274,7 +276,7 @@
275277 }
276278
277279 /**
278 - * Registeres a geocoder linked to an identifier.
 280+ * Registers a geocoder linked to an identifier.
279281 *
280282 * @since 0.7
281283 *
@@ -344,7 +346,7 @@
345347 * @return string or false
346348 */
347349 protected static function getValidGeocoderIdentifier( $geocoderIdentifier ) {
348 - global $egMapsDefaultGeoService, $egMapsUserGeoOverrides;
 350+ global $egMapsDefaultGeoService;
349351 static $validatedDefault = false;
350352
351353 if ( $geocoderIdentifier === '' || !array_key_exists( $geocoderIdentifier, self::$registeredGeocoders ) ) {
Index: trunk/extensions/Maps/includes/Maps_Layer.php
@@ -7,8 +7,9 @@
88 *
99 * @file Maps_Layer.php
1010 * @ingroup Maps
11 - *
12 - * @author Jeroen De Dauw
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 abstract class MapsLayer {
1516
Index: trunk/extensions/Maps/includes/Maps_MappingService.php
@@ -9,7 +9,8 @@
1010 * @file Maps_MappingService.php
1111 * @ingroup Maps
1212 *
13 - * @author Jeroen De Dauw
 13+ * @licence GNU GPL v3
 14+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1415 */
1516 abstract class MapsMappingService implements iMappingService {
1617
Index: trunk/extensions/Maps/includes/Maps_Mapper.php
@@ -7,8 +7,9 @@
88 *
99 * @file Maps_Mapper.php
1010 * @ingroup Maps
11 - *
12 - * @author Jeroen De Dauw
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 final class MapsMapper {
1516
Index: trunk/extensions/Maps/includes/Maps_Geocoder.php
@@ -7,8 +7,9 @@
88 *
99 * @file Maps_Geocoder.php
1010 * @ingroup Maps
11 - *
12 - * @author Jeroen De Dauw
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 abstract class MapsGeocoder {
1516
@@ -46,7 +47,7 @@
4748 *
4849 * @since 0.7
4950 *
50 - * @param string $address
 51+ * @param string $response
5152 *
5253 * @return array
5354 */
@@ -89,7 +90,9 @@
9091 * Returns if the geocoder has a certain alias.
9192 *
9293 * @since 0.7
93 - *
 94+ *
 95+ * @param string $alias
 96+ *
9497 * @return boolean
9598 */
9699 public function hasAlias( $alias ) {
Index: trunk/extensions/Maps/includes/Maps_Layers.php
@@ -7,8 +7,9 @@
88 *
99 * @file Maps_Layers.php
1010 * @ingroup Maps
11 - *
12 - * @author Jeroen De Dauw
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 class MapsLayers {
1516
Index: trunk/extensions/Maps/includes/Maps_MappingServices.php
@@ -7,8 +7,9 @@
88 *
99 * @file Maps_MappingServices.php
1010 * @ingroup Maps
11 - *
12 - * @author Jeroen De Dauw
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 final class MapsMappingServices {
1516
Index: trunk/extensions/Maps/includes/Maps_Settings.php
@@ -311,9 +311,9 @@
312312 *
313313 * @since ?
314314 *
315 - * @param name $group
 315+ * @param string $groupName
316316 */
317 - protected static function ivalidateCachesForGroup( $group ) {
 317+ protected static function ivalidateCachesForGroup( $groupName ) {
318318 foreach ( array_keys( static::$mergedCaches ) as $cacheName ) {
319319 if ( in_array( $groupName, explode( '|', $cacheName ) ) ) {
320320 unset( static::$mergedCaches[$cacheName] );
Index: trunk/extensions/Maps/includes/Maps_GeoFunctions.php
@@ -11,7 +11,8 @@
1212 * @file Maps_GeoFunctions.php
1313 * @ingroup Maps
1414 *
15 - * @author Jeroen De Dauw
 15+ * @licence GNU GPL v3
 16+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1617 * @author Pnelnik
1718 * @author Matěj Grabovský
1819 */
Index: trunk/extensions/Maps/includes/Maps_CoordinateParser.php
@@ -17,8 +17,9 @@
1818 *
1919 * @file Maps_CoordinateParser.php
2020 * @ingroup Maps
21 - *
22 - * @author Jeroen De Dauw
 21+ *
 22+ * @licence GNU GPL v3
 23+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
2324 */
2425 class MapsCoordinateParser {
2526
Index: trunk/extensions/Maps/includes/iMappingService.php
@@ -7,8 +7,9 @@
88 *
99 * @file iMappingService.php
1010 * @ingroup Maps
11 - *
12 - * @author Jeroen De Dauw
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 interface iMappingService {
1516
Index: trunk/extensions/Maps/includes/Maps_KMLFormatter.php
@@ -7,8 +7,9 @@
88 *
99 * @file Maps_KMLFormatter.php
1010 * @ingroup Maps
11 - *
12 - * @author Jeroen De Dauw
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 class MapsKMLFormatter {
1516
Index: trunk/extensions/Maps/includes/Maps_DistanceParser.php
@@ -7,8 +7,9 @@
88 * @ingroup Maps
99 *
1010 * @since 0.6
11 - *
12 - * @author Jeroen De Dauw
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 class MapsDistanceParser {
1516
Index: trunk/extensions/Maps/includes/Maps_Location.php
@@ -7,8 +7,9 @@
88 *
99 * @file Maps_Location.php
1010 * @ingroup Maps
11 - *
12 - * @author Jeroen De Dauw
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 * @author Daniel Werner
1415 */
1516 class MapsLocation {
Index: trunk/extensions/Maps/Maps.hooks.php
@@ -17,10 +17,12 @@
1818 * Adds a link to Admin Links page.
1919 *
2020 * @since 0.7
21 - *
 21+ *
 22+ * @param array $admin_links_tree
 23+ *
2224 * @return true
2325 */
24 - public static function addToAdminLinks( &$admin_links_tree ) {
 26+ public static function addToAdminLinks( array &$admin_links_tree ) {
2527 $displaying_data_section = $admin_links_tree->getSection( wfMsg( 'smw_adminlinks_displayingdata' ) );
2628
2729 // Escape if SMW hasn't added links.
@@ -39,6 +41,8 @@
4042 * @since 0.7
4143 *
4244 * @param array $files
 45+ *
 46+ * @return true
4347 */
4448 public static function registerUnitTests( array &$files ) {
4549 $testDir = dirname( __FILE__ ) . '/test/';
@@ -84,8 +88,14 @@
8589 return true;
8690 }
8791
88 -
89 - public static function onCanonicalNamespaces( &$list ) {
 92+ /**
 93+ * @since 0.7
 94+ *
 95+ * @param array $list
 96+ *
 97+ * @return true
 98+ */
 99+ public static function onCanonicalNamespaces( array &$list ) {
90100 $list[Maps_NS_LAYER] = 'Layer';
91101 $list[Maps_NS_LAYER_TALK] = 'Layer_talk';
92102 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r107726follow up to r107700jeroendedauw17:55, 31 December 2011

Comments

#Comment by Raymond (talk | contribs)   09:09, 31 December 2011

Somewhere in this series of revisions:

 PHP Strict Standards: Only variables should be passed by reference in /www/w/extensions/Maps/includes/manipulations/Maps_ParamGeoService.php on line 61

Status & tagging log