Completed
Pull Request — 3.1 (#49)
by
unknown
11:49
created
code/MapExtension.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@
 block discarded – undo
204 204
     /**
205 205
      * Access the map editing field for the purpose of adding guide points.
206 206
      *
207
-     * @return [LatLongField] instance of location editing field
207
+     * @return FormField instance of location editing field
208 208
      */
209 209
     public function getMapField()
210 210
     {
Please login to merge, or discard this patch.
tests/MapExtensionTest.php 1 patch
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -265,6 +265,10 @@  discard block
 block discarded – undo
265 265
     /*
266 266
     Add a map layer to an existing instance
267 267
      */
268
+
269
+    /**
270
+     * @param Member $instance
271
+     */
268 272
     private function addLayerToInstance(&$instance)
269 273
     {
270 274
         // Create a layer
@@ -279,6 +283,9 @@  discard block
 block discarded – undo
279 283
         $layers->add($layer);
280 284
     }
281 285
 
286
+    /**
287
+     * @param Member $instance
288
+     */
282 289
     private function addMapPinToInstance(&$instance)
283 290
     {
284 291
         // Create a pin
Please login to merge, or discard this patch.
code/LatLongField.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             'data-LonFieldName' => $this->longField,
66 66
             'data-ZoomFieldName' => $this->zoomField,
67 67
             'data-UseMapBounds' => false,
68
-       );
68
+        );
69 69
 
70 70
         Requirements::css('mappable/css/mapField.css');
71 71
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         $content = '<div class="editableMapWrapper">'.$this->create_tag(
90 90
             'div',
91 91
             $attributes
92
-       ).'</div>';
92
+        ).'</div>';
93 93
 
94 94
         $this->FieldList()->push(new LiteralField('locationEditor', $content));
95 95
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@
 block discarded – undo
18 18
      * @param string[] $buttonText
19 19
      */
20 20
     public function __construct($children = array(), $buttonText = null)
21
-    {
22
-        ++self::$ctr;
21
+    {++self::$ctr;
23 22
 
24 23
         if ((sizeof($children) < 2) || (sizeof($children) > 3) ||
25 24
              (!$children[0] instanceof FormField) ||
Please login to merge, or discard this patch.
code/MapUtil.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,8 +132,7 @@
 block discarded – undo
132 132
      * @return MapAPI
133 133
      */
134 134
     public static function instance()
135
-    {
136
-        ++self::$instances;
135
+    {++self::$instances;
137 136
 
138 137
         if (self::$allow_full_screen == null) {
139 138
             self::$allow_full_screen = Config::inst()->get('Mappable', 'allow_full_screen');
Please login to merge, or discard this patch.
code/shortcodes/GoogleMapShortCodeHandler.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@
 block discarded – undo
50 50
         // fullscreen
51 51
         $arguments['AllowFullScreen'] = Config::inst()->get('Mappable', 'allow_full_screen');
52 52
 
53
-        // incrememt the counter to ensure a unique id for each map canvas
54
-        ++self::$gsv_ctr;
53
+        // incrememt the counter to ensure a unique id for each map canvas++self::$gsv_ctr;
55 54
 
56 55
         // merge defaults and arguments
57 56
         $customised = array_merge($defaults, $arguments);
Please login to merge, or discard this patch.
code/shortcodes/GoogleStreetViewShortCodeHandler.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@
 block discarded – undo
53 53
         // the id of the dom element to be used to render the street view
54 54
         $arguments['DomID'] = 'google_streetview_'.self::$gsv_ctr;
55 55
 
56
-        // incrememt the counter to ensure a unique id for each map canvas
57
-        ++self::$gsv_ctr;
56
+        // incrememt the counter to ensure a unique id for each map canvas++self::$gsv_ctr;
58 57
 
59 58
         // merge defaults and arguments
60 59
         $customised = array_merge($defaults, $arguments);
Please login to merge, or discard this patch.
tests/LatLongFieldTest.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
             $this->fail('Creation of lat long field should have failed');
25 25
         } catch (Exception $e) {
26 26
             $expected = 'LatLongField argument 1 must be an array containing at'
27
-                      .' least two FormField objects for Lat/Long values, resp'
28
-                      .'ectively.';
27
+                        .' least two FormField objects for Lat/Long values, resp'
28
+                        .'ectively.';
29 29
             $this->assertEquals($expected, $e->getMessage());
30 30
         }
31 31
     }
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 
119 119
         $html = $mapField->FieldHolder();
120 120
         $expected = 'data-GuidePoints="[{&quot;latitude&quot;:42,&quot;longitude&quot;:&quot;113.1&'
121
-                  .'quot;},{&quot;latitude&quot;:14.9,&quot;longitude&quot;:&quot;113.2&quot;},{&q'
122
-                  .'uot;latitude&quot;:42.3,&quot;longitude&quot;:&quot;113.4&quot;}]"';
121
+                    .'quot;},{&quot;latitude&quot;:14.9,&quot;longitude&quot;:&quot;113.2&quot;},{&q'
122
+                    .'uot;latitude&quot;:42.3,&quot;longitude&quot;:&quot;113.4&quot;}]"';
123 123
 
124 124
         $this->assertContains($expected, $html);
125 125
     }
Please login to merge, or discard this patch.
tests/MapAPITest.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
         $map = $this->getMapMultipleItems();
305 305
         $html = $map->forTemplate();
306 306
         $expected = 'data-mapmarkers=\'[{"latitude":23,"longitude":78,"html":"'
307
-                  .'MEMBER: Fred Bloggs","category":"default","icon":false},{"latitude'
308
-                  .'":-12,"longitude":42.1,"html":"MEMBER: Kane Williamson","category"'
309
-                  .':"default","icon":false}]\'';
307
+                    .'MEMBER: Fred Bloggs","category":"default","icon":false},{"latitude'
308
+                    .'":-12,"longitude":42.1,"html":"MEMBER: Kane Williamson","category"'
309
+                    .':"default","icon":false}]\'';
310 310
         $this->assertContains($expected, $html);
311 311
     }
312 312
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
     {
339 339
         $map = $this->getMap();
340 340
         $filepath = 'file://'.Director::baseFolder()
341
-                  .'/mappable/tests/kml/example.kml';
341
+                    .'/mappable/tests/kml/example.kml';
342 342
         $content = $map->getContent($filepath);
343 343
         $textHash = hash('ripemd160', $content);
344 344
         $fileHash = hash_file('ripemd160', $filepath);
Please login to merge, or discard this patch.
tests/MapFieldTest.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
         //$headingLevel = 2, $allowHTML = false, $form = nul
8 8
         $field = new MapField('NameOfField', 'TitleOfField');
9 9
         $expected = '<div class="editableMap"><div class="middleColumn" id="Nam'
10
-                  .'eOfField" style="width:100%;height:300px;margin:5px 0px 5p'
11
-                  .'x 5px;position:relative;"></div></div>';
10
+                    .'eOfField" style="width:100%;height:300px;margin:5px 0px 5p'
11
+                    .'x 5px;position:relative;"></div></div>';
12 12
         $this->assertEquals($expected, $field->Field());
13 13
     }
14 14
 
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
         //$headingLevel = 2, $allowHTML = false, $form = nul
18 18
         $field = new MapField('NameOfField');
19 19
         $expected = '<div class="editableMap"><div class="middleColumn" id="Nam'
20
-                  .'eOfField" style="width:100%;height:300px;margin:5px 0px 5p'
21
-                  .'x 5px;position:relative;"></div></div>';
20
+                    .'eOfField" style="width:100%;height:300px;margin:5px 0px 5p'
21
+                    .'x 5px;position:relative;"></div></div>';
22 22
         $this->assertEquals($expected, $field->Field());
23 23
     }
24 24
 }
Please login to merge, or discard this patch.