Completed
Push — 1.2 ( d2001b...d993e9 )
by Daniel
02:12
created
code/GoogleMapField.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -98,6 +98,9 @@
 block discarded – undo
98 98
 		return $this->data->$fieldNames['lng'];
99 99
 	}
100 100
 
101
+	/**
102
+	 * @param string $name
103
+	 */
101 104
 	public function getOption($name) {
102 105
 		// Quicker execution path for "."-free names
103 106
 		if (strpos($name, '.') === false) {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 
50 50
 	public function Field($properties = array()) {
51
-		$key = $this->options['apikey'] ? "&key=".$this->options['apikey'] : "";
52
-		Requirements::javascript(GOOGLEMAPFIELD_BASE .'/javascript/GoogleMapField.js');
53
-		Requirements::javascript("//maps.googleapis.com/maps/api/js?callback=googlemapfieldInit".$key);
54
-		Requirements::css(GOOGLEMAPFIELD_BASE .'/css/GoogleMapField.css');
51
+		$key = $this->options['apikey'] ? "&key=" . $this->options['apikey'] : "";
52
+		Requirements::javascript(GOOGLEMAPFIELD_BASE . '/javascript/GoogleMapField.js');
53
+		Requirements::javascript("//maps.googleapis.com/maps/api/js?callback=googlemapfieldInit" . $key);
54
+		Requirements::css(GOOGLEMAPFIELD_BASE . '/css/GoogleMapField.css');
55 55
 		$jsOptions = array(
56 56
 			'coords' => array($this->getLatData(), $this->getLngData()),
57 57
 			'map' => array(
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 				'mapTypeId' => 'ROADMAP',
60 60
 			),
61 61
 		);
62
-		if(!$this->options['showSearchBox']){
62
+		if (!$this->options['showSearchBox']) {
63 63
 			$this->children->removeByName("Search");
64 64
 		}
65 65
 		$jsOptions = array_replace_recursive($jsOptions, $this->options);
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
 
114 114
 			$var = $this->options;
115 115
 
116
-			foreach($names as $n) {
117
-				if(!isset($var[$n])) {
116
+			foreach ($names as $n) {
117
+				if (!isset($var[$n])) {
118 118
 					return null;
119 119
 				}
120 120
 				$var = $var[$n];
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
 	public function setOption($name, $val) {
128 128
 		// Quicker execution path for "."-free names
129
-		if(strpos($name,'.') === false) {
129
+		if (strpos($name, '.') === false) {
130 130
 			$this->options[$name] = $val;
131 131
 		} else {
132 132
 			$names = explode('.', $name);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 			// We still want to do this even if we have strict path checking for legacy code
135 135
 			$var = &$this->options;
136 136
 
137
-			foreach($names as $n) {
137
+			foreach ($names as $n) {
138 138
 				$var = &$var[$n];
139 139
 			}
140 140
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 				'mapTypeId' => 'ROADMAP',
60 60
 			),
61 61
 		);
62
-		if(!$this->options['showSearchBox']){
62
+		if(!$this->options['showSearchBox']) {
63 63
 			$this->children->removeByName("Search");
64 64
 		}
65 65
 		$jsOptions = array_replace_recursive($jsOptions, $this->options);
@@ -107,7 +107,9 @@  discard block
 block discarded – undo
107 107
 	public function getOption($name) {
108 108
 		// Quicker execution path for "."-free names
109 109
 		if (strpos($name, '.') === false) {
110
-			if (isset($this->options[$name])) return $this->options[$name];
110
+			if (isset($this->options[$name])) {
111
+				return $this->options[$name];
112
+			}
111 113
 		} else {
112 114
 			$names = explode('.', $name);
113 115
 
Please login to merge, or discard this patch.