Skip to content

Commit 94420f2

Browse files
authored
Apply fixes from StyleCI (#2)
1 parent 58a50a8 commit 94420f2

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

UrbIS.php

+22-22
Original file line numberDiff line numberDiff line change
@@ -113,35 +113,35 @@ public function geocodeQuery(GeocodeQuery $query): Collection
113113
*/
114114
public function reverseQuery(ReverseQuery $query): Collection
115115
{
116-
$coordinates = $query->getCoordinates();
116+
$coordinates = $query->getCoordinates();
117117

118-
$jsonQuery = [
118+
$jsonQuery = [
119119
'language' => $query->getLocale(),
120-
'point' => [
120+
'point' => [
121121
'x' => $coordinates->getLongitude(),
122-
'y' => $coordinates->getLatitude()
122+
'y' => $coordinates->getLatitude(),
123123
],
124-
'spatialReference' => 4326
124+
'spatialReference' => 4326,
125125
];
126126

127-
$url = sprintf(self::REVERSE_ENDPOINT_URL, urlencode(json_encode($jsonQuery)));
128-
$json = $this->executeQuery($url);
129-
130-
// no result
131-
if (empty($json->result)) {
132-
return new AddressCollection([]);
133-
}
127+
$url = sprintf(self::REVERSE_ENDPOINT_URL, urlencode(json_encode($jsonQuery)));
128+
$json = $this->executeQuery($url);
134129

135-
$results = [];
136-
$location = $json->result;
137-
$coordinates = $location->point;
138-
$streetName = !empty($location->address->street->name) ? $location->address->street->name : null;
139-
$number = !empty($location->address->number) ? $location->address->number : null;
140-
$municipality = !empty($location->address->street->municipality) ? $location->address->street->municipality : null;
141-
$postCode = !empty($location->address->street->postCode) ? $location->address->street->postCode : null;
142-
$countryCode = 'BE';
130+
// no result
131+
if (empty($json->result)) {
132+
return new AddressCollection([]);
133+
}
143134

144-
$results[] = Address::createFromArray([
135+
$results = [];
136+
$location = $json->result;
137+
$coordinates = $location->point;
138+
$streetName = !empty($location->address->street->name) ? $location->address->street->name : null;
139+
$number = !empty($location->address->number) ? $location->address->number : null;
140+
$municipality = !empty($location->address->street->municipality) ? $location->address->street->municipality : null;
141+
$postCode = !empty($location->address->street->postCode) ? $location->address->street->postCode : null;
142+
$countryCode = 'BE';
143+
144+
$results[] = Address::createFromArray([
145145
'providedBy' => $this->getName(),
146146
'latitude' => $coordinates->y,
147147
'longitude' => $coordinates->x,
@@ -152,7 +152,7 @@ public function reverseQuery(ReverseQuery $query): Collection
152152
'countryCode' => $countryCode,
153153
]);
154154

155-
return new AddressCollection($results);
155+
return new AddressCollection($results);
156156
}
157157

158158
/**

0 commit comments

Comments
 (0)