Completed
Pull Request — master (#35)
by Luke
01:32
created
src/GoogleMapField.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	public function setupOptions(array $options) {
86 86
 		$this->options = static::config()->default_options;
87
-		foreach($this->options as $name => &$value) {
88
-			if(isset($options[$name])) {
89
-				if(is_array($value)) {
87
+		foreach ($this->options as $name => &$value) {
88
+			if (isset($options[$name])) {
89
+				if (is_array($value)) {
90 90
 					$value = array_merge($value, $options[$name]);
91 91
 				}
92 92
 				else {
@@ -105,24 +105,24 @@  discard block
 block discarded – undo
105 105
 
106 106
 		// Create the latitude/longitude hidden fields
107 107
 		$this->latField = HiddenField::create(
108
-			$name.'[Latitude]',
108
+			$name . '[Latitude]',
109 109
 			'Lat',
110 110
 			$this->recordFieldData('Latitude')
111 111
 		)->addExtraClass('googlemapfield-latfield no-change-track');
112 112
 
113 113
 		$this->lngField = HiddenField::create(
114
-			$name.'[Longitude]',
114
+			$name . '[Longitude]',
115 115
 			'Lng',
116 116
 			$this->recordFieldData('Longitude')
117 117
 		)->addExtraClass('googlemapfield-lngfield no-change-track');
118 118
 
119 119
 		$this->zoomField = HiddenField::create(
120
-			$name.'[Zoom]',
120
+			$name . '[Zoom]',
121 121
 			'Zoom',
122 122
 			$this->recordFieldData('Zoom')
123 123
 		)->addExtraClass('googlemapfield-zoomfield no-change-track');
124 124
 		$this->boundsField = HiddenField::create(
125
-			$name.'[Bounds]',
125
+			$name . '[Bounds]',
126 126
 			'Bounds',
127 127
 			$this->recordFieldData('Bounds')
128 128
 		)->addExtraClass('googlemapfield-boundsfield no-change-track');
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 			$this->boundsField
134 134
 		);
135 135
 
136
-		if($this->options['show_search_box']) {
136
+		if ($this->options['show_search_box']) {
137 137
 			$this->children->push(
138 138
 				TextField::create('Search')
139 139
 				->addExtraClass('googlemapfield-searchfield')
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		$gmapsParams = array(
176 176
 			'callback' => 'googlemapfieldInit',
177 177
 		);
178
-		if($key = $this->getOption('api_key')) {
178
+		if ($key = $this->getOption('api_key')) {
179 179
 			$gmapsParams['key'] = $key;
180 180
 		}
181 181
 		$this->extend('updateGoogleMapsParams', $gmapsParams);
@@ -267,8 +267,8 @@  discard block
 block discarded – undo
267 267
 
268 268
 			$var = $this->options;
269 269
 
270
-			foreach($names as $n) {
271
-				if(!isset($var[$n])) {
270
+			foreach ($names as $n) {
271
+				if (!isset($var[$n])) {
272 272
 					return null;
273 273
 				}
274 274
 				$var = $var[$n];
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 	 */
287 287
 	public function setOption($name, $val) {
288 288
 		// Quicker execution path for "."-free names
289
-		if(strpos($name,'.') === false) {
289
+		if (strpos($name, '.') === false) {
290 290
 			$this->options[$name] = $val;
291 291
 		} else {
292 292
 			$names = explode('.', $name);
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 			// We still want to do this even if we have strict path checking for legacy code
295 295
 			$var = &$this->options;
296 296
 
297
-			foreach($names as $n) {
297
+			foreach ($names as $n) {
298 298
 				$var = &$var[$n];
299 299
 			}
300 300
 
Please login to merge, or discard this patch.