Completed
Push — AUTOMATED_TESTING ( 6d2161...4cfed4 )
by Gordon
144:02 queued 110:40
created
code/MapExtension.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@
 block discarded – undo
184 184
 
185 185
 	/**
186 186
 	 * Access the map editing field for the purpose of adding guide points
187
-	 * @return [LatLongField] instance of location editing field
187
+	 * @return FormField instance of location editing field
188 188
 	 */
189 189
 	public function getMapField() {
190 190
 		if (!isset($this->mapField)) {
Please login to merge, or discard this patch.
Indentation   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -186,8 +186,7 @@
 block discarded – undo
186 186
 			}
187 187
 			$map->setClusterer(true);
188 188
 		}
189
-
190
-		**/
189
+		 **/
191 190
 
192 191
 		$map->setEnableAutomaticCenterZoom($autozoom);
193 192
 		$map->setShowInlineMapDivStyle(true);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 		'MapPinIcon' => 'Image'
19 19
 	);
20 20
 
21
-	static $defaults = array (
21
+	static $defaults = array(
22 22
 		'Lat' =>0,
23 23
 		'Lon' => 0,
24 24
 		'Zoom' => 4,
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
 		// add any KML map layers
156 156
 		if (Object::has_extension($this->owner->ClassName, 'MapLayerExtension')) {
157
-		  foreach($this->owner->MapLayers() as $layer) {
157
+		  foreach ($this->owner->MapLayers() as $layer) {
158 158
 			$map->addKML($layer->KmlFile()->getAbsoluteURL());
159 159
 			// we have a layer, so turn on autozoom
160 160
 			$autozoom = true;
Please login to merge, or discard this patch.
code/shortcodes/GoogleStreetViewShortCodeHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,15 +8,15 @@
 block discarded – undo
8 8
 
9 9
 	public static function parse_googlestreetview($arguments, $caption = null, $parser = null) {
10 10
 		// each of latitude, longitude and heading are required at a bare minimum
11
-		if(!isset($arguments['latitude'])){
11
+		if (!isset($arguments['latitude'])) {
12 12
 			return '';
13 13
 		}
14 14
 
15
-		if(!isset($arguments['longitude'])){
15
+		if (!isset($arguments['longitude'])) {
16 16
 			return '';
17 17
 		}
18 18
 
19
-		if(!isset($arguments['heading'])){
19
+		if (!isset($arguments['heading'])) {
20 20
 			return '';
21 21
 		}
22 22
 
Please login to merge, or discard this patch.
code/shortcodes/GoogleMapShortCodeHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
 
8 8
 	public static function parse_googlemap($arguments, $caption = null, $parser = null) {
9 9
 		// each of latitude and longitude are required at a bare minimum
10
-		if(!isset($arguments['latitude'])){
10
+		if (!isset($arguments['latitude'])) {
11 11
 			return '';
12 12
 		}
13 13
 
14
-		if(!isset($arguments['longitude'])){
14
+		if (!isset($arguments['longitude'])) {
15 15
 			return '';
16 16
 		}
17 17
 
Please login to merge, or discard this patch.
code/MappableDataObjectSet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 		$gmap = MapUtil::get_map($this->owner, $this->MarkerTemplateValues);
28 28
 		$w = $width ? $width : MapUtil::$map_width;
29 29
 		$h = $height ? $height : MapUtil::$map_height;
30
-		$gmap->setSize($w,$h);
30
+		$gmap->setSize($w, $h);
31 31
 		return $gmap;
32 32
 	}
33 33
 
Please login to merge, or discard this patch.
code/MapField.php 3 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,19 +15,19 @@  discard block
 block discarded – undo
15 15
 				// legacy handling for old parameters: $title, $heading, ...
16 16
 				// instead of new handling: $name, $title, $heading, ...
17 17
 				$args = func_get_args();
18
-				if(!isset($args[1]) || is_numeric($args[1])) {
18
+				if (!isset($args[1]) || is_numeric($args[1])) {
19 19
 						$title = (isset($args[0])) ? $args[0] : null;
20 20
 						// Use "HeaderField(title)" as the default field name for a HeaderField;
21 21
 						// if it's just set to title then we risk causing accidental duplicate-field creation.
22 22
 
23 23
 						// this means i18nized fields won't be easily accessible through fieldByName()
24
-						$name = 'MapField' . $title;
24
+						$name = 'MapField'.$title;
25 25
 						$headingLevel = (isset($args[1])) ? $args[1] : null;
26 26
 						$allowHTML = (isset($args[2])) ? $args[2] : null;
27 27
 						$form = (isset($args[3])) ? $args[3] : null;
28 28
 				}
29 29
 
30
-				if($headingLevel) $this->headingLevel = $headingLevel;
30
+				if ($headingLevel) $this->headingLevel = $headingLevel;
31 31
 				$this->allowHTML = $allowHTML;
32 32
 				parent::__construct($name, $title, null, $allowHTML, $form);
33 33
 		}
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
 
53 53
 				Requirements::css('mappable/css/mapField.css');
54 54
 
55
-				return '<div class="editableMap">' . $this->createTag(
55
+				return '<div class="editableMap">'.$this->createTag(
56 56
 						"div",
57 57
 						$attributes
58
-				) . '</div>';
58
+				).'</div>';
59 59
 		}
60 60
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,9 @@
 block discarded – undo
27 27
 						$form = (isset($args[3])) ? $args[3] : null;
28 28
 				}
29 29
 
30
-				if($headingLevel) $this->headingLevel = $headingLevel;
30
+				if($headingLevel) {
31
+					$this->headingLevel = $headingLevel;
32
+				}
31 33
 				$this->allowHTML = $allowHTML;
32 34
 				parent::__construct($name, $title, null, $allowHTML, $form);
33 35
 		}
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Map field to point for pois langitude and longitude positioning
4
- */
3
+	 * Map field to point for pois langitude and longitude positioning
4
+	 */
5 5
 class MapField extends DatalessField {
6 6
 
7 7
 		/**
Please login to merge, or discard this patch.
code/MappableData.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		$gmap = MapUtil::get_map(new ArrayList(array($this->owner)), $this->MarkerTemplateValues);
41 41
 		$w = $width ? $width : MapUtil::$map_width;
42 42
 		$h = $height ? $height : MapUtil::$map_height;
43
-		$gmap->setSize($w,$h);
43
+		$gmap->setSize($w, $h);
44 44
 		$gmap->setZoom($zoom);
45 45
 		$gmap->setEnableAutomaticCenterZoom(false);
46 46
 		if ($this->owner->MapPinEdited) {
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 			$urlparts['markers'] = "icon:$pin|$lat,$lng";
90 90
 		}
91 91
 
92
-		$src = htmlentities($apiurl . '?' . http_build_query($urlparts));
92
+		$src = htmlentities($apiurl.'?'.http_build_query($urlparts));
93 93
 		return '<img src="'.$src.'" width="'.$w.'" height="'.$h.'" alt="'.$this->owner->Title.'" />';
94 94
 	}
95 95
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 		}
81 81
 
82 82
 		//https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400&key=YOUR_API_KEY
83
-			    //maps.googleapis.com/maps/api/staticmap';
83
+				//maps.googleapis.com/maps/api/staticmap';
84 84
 
85 85
 		$apiurl = Config::inst()->get('MappableData', 'staticmap_api_url');
86 86
 
Please login to merge, or discard this patch.
code/Mappable.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Defines the interface for a mappable DataObject. Implementors of this interface
4
- * must define the following functions in order to work with the {@link GoogleMapUtil}
5
- * helper class.
6
- *
7
- * @author Uncle Cheese
8
- * @package mappable
9
- */
3
+	 * Defines the interface for a mappable DataObject. Implementors of this interface
4
+	 * must define the following functions in order to work with the {@link GoogleMapUtil}
5
+	 * helper class.
6
+	 *
7
+	 * @author Uncle Cheese
8
+	 * @package mappable
9
+	 */
10 10
 interface Mappable {
11 11
 
12 12
 	/**
Please login to merge, or discard this patch.
code/MapAPI.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -397,10 +397,10 @@
 block discarded – undo
397 397
 	}
398 398
 
399 399
 	/**
400
-	* Set the center of the gmap
401
-	*
402
-	* @return MapAPI This same object, in order to enable chaining of methods
403
-	**/
400
+	 * Set the center of the gmap
401
+	 *
402
+	 * @return MapAPI This same object, in order to enable chaining of methods
403
+	 **/
404 404
 	public function setLatLongCenter($center) {
405 405
 		$this->latLongCenter = $center;
406 406
 		return $this;
Please login to merge, or discard this patch.
Doc Comments   +15 added lines, -8 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 *
164 164
 	 * @param string  $googleMapKey the googleMapKey
165 165
 	 *
166
-	 * @return void
166
+	 * @return MapAPI
167 167
 	 */
168 168
 
169 169
 	public function setKey($googleMapKey) {
@@ -171,6 +171,9 @@  discard block
 block discarded – undo
171 171
 		return $this;
172 172
 	}
173 173
 
174
+	/**
175
+	 * @param boolean $inclusion
176
+	 */
174 177
 	public function setIncludeDownloadJavascript($inclusion) {
175 178
 		self::$include_download_javascript = $inclusion;
176 179
 		return $this;
@@ -424,7 +427,7 @@  discard block
 block discarded – undo
424 427
 	 *
425 428
 	 * @param boolean $defaultHideMarker hide all the markers on the map by default
426 429
 	 *
427
-	 * @return void
430
+	 * @return MapAPI
428 431
 	 */
429 432
 
430 433
 	public function setDefaultHideMarker($defaultHideMarker) {
@@ -469,7 +472,7 @@  discard block
 block discarded – undo
469 472
 	 *
470 473
 	 * @param string  $address an address
471 474
 	 *
472
-	 * @return array array with precision, lat & lng
475
+	 * @return string array with precision, lat & lng
473 476
 	 */
474 477
 
475 478
 	public function geocoding($address) {
@@ -498,7 +501,7 @@  discard block
 block discarded – undo
498 501
 	 * @param string  $category marker category
499 502
 	 * @param string  $icon     an icon url
500 503
 	 *
501
-	 * @return void
504
+	 * @return MapAPI
502 505
 	 */
503 506
 
504 507
 	public function addMarkerByCoords($lat, $lng, $html = '', $category = '', $icon = '') {
@@ -522,7 +525,7 @@  discard block
 block discarded – undo
522 525
 	 * @param string  $category marker category
523 526
 	 * @param string  $icon     an icon url
524 527
 	 *
525
-	 * @return void
528
+	 * @return MapAPI
526 529
 	 */
527 530
 
528 531
 	public function addMarkerByAddress($address, $content = '', $category = '', $icon = '') {
@@ -540,7 +543,7 @@  discard block
 block discarded – undo
540 543
 	 * @param string  $category marker category
541 544
 	 * @param string  $icon     an icon url
542 545
 	 *
543
-	 * @return void
546
+	 * @return MapAPI
544 547
 	 */
545 548
 
546 549
 	public function addArrayMarkerByCoords($coordtab, $category = '', $icon = '') {
@@ -623,7 +626,7 @@  discard block
 block discarded – undo
623 626
 	 * @param string  $category marker category
624 627
 	 * @param string  $icon     an icon url
625 628
 	 *
626
-	 * @return void
629
+	 * @return MapAPI
627 630
 	 */
628 631
 
629 632
 	public function addArrayMarkerByAddress($coordtab, $category = '', $icon = '') {
@@ -652,7 +655,7 @@  discard block
 block discarded – undo
652 655
 	 *
653 656
 	 * @param string  $url      url of the kml file compatible with gmap and gearth
654 657
 	 *
655
-	 * @return void
658
+	 * @return MapAPI
656 659
 	 */
657 660
 
658 661
 	public function addKML($url) {
@@ -809,6 +812,10 @@  discard block
 block discarded – undo
809 812
 		return $result;
810 813
 	}
811 814
 
815
+	/**
816
+	 * @param string $templateName
817
+	 * @param ArrayData $templateVariables
818
+	 */
812 819
 	function processTemplateHTML($templateName, $templateVariables = null) {
813 820
 		if (!$templateVariables) {
814 821
 			$templateVariables = new ArrayList();
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -717,7 +717,7 @@
 block discarded – undo
717 717
 							$this->latLongCenter : $this->geocoding($this->center);
718 718
 
719 719
 		// coordinates for centre depending on which method used
720
-		if (isset($geocodeCentre['geocoded'] )) {
720
+		if (isset($geocodeCentre['geocoded'])) {
721 721
 			$latlngCentre = array(
722 722
 				'lat' => $geocodeCentre['lat'],
723 723
 				'lng' => $geocodeCentre['lon']
Please login to merge, or discard this patch.
code/MapUtil.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -226,8 +226,9 @@
 block discarded – undo
226 226
 		$gmap = self::instance();
227 227
 		if ($list) {
228 228
 			foreach ($list as $mappable) {
229
-				if (self::ChooseToAddDataobject($mappable))
230
-					$gmap->addMarkerAsObject($mappable, $infowindowtemplateparams);
229
+				if (self::ChooseToAddDataobject($mappable)) {
230
+									$gmap->addMarkerAsObject($mappable, $infowindowtemplateparams);
231
+				}
231 232
 			}
232 233
 		}
233 234
 		return $gmap;
Please login to merge, or discard this patch.