@@ -137,16 +137,16 @@ discard block |
||
| 137 | 137 | * |
| 138 | 138 | * @return $this |
| 139 | 139 | */ |
| 140 | - public function setValue($value, $type=null) |
|
| 140 | + public function setValue($value, $type = null) |
|
| 141 | 141 | { |
| 142 | 142 | if ($value instanceOf Location) { |
| 143 | 143 | $value = $this->getConverter()->toValue($value, $type ?: $this->typeElement->getValue()); |
| 144 | 144 | } |
| 145 | 145 | if ('geo' == $value['type'] && empty($value['data'])) { |
| 146 | 146 | $lonLat = $this->getConverter()->toCoordinates($value['name']); |
| 147 | - foreach($lonLat as $k=>$v) { |
|
| 148 | - list($lon,$lat) = explode(',', $v, 2); |
|
| 149 | - $latLon[]=$lat.','.$lon; |
|
| 147 | + foreach ($lonLat as $k=>$v) { |
|
| 148 | + list($lon, $lat) = explode(',', $v, 2); |
|
| 149 | + $latLon[] = $lat . ',' . $lon; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | $value['data'] = [ |
@@ -155,8 +155,8 @@ discard block |
||
| 155 | 155 | (float) $lon |
| 156 | 156 | ], |
| 157 | 157 | 'type'=>'Point', |
| 158 | - 'city' => substr($value['name'],0,strrpos($value['name'], ',' )), |
|
| 159 | - 'region' => substr($value['name'],strrpos($value['name'], ',' )+2), |
|
| 158 | + 'city' => substr($value['name'], 0, strrpos($value['name'], ',')), |
|
| 159 | + 'region' => substr($value['name'], strrpos($value['name'], ',') + 2), |
|
| 160 | 160 | 'postalcode' =>'', |
| 161 | 161 | 'country' => 'DE']; |
| 162 | 162 | } |