Skip to content

Commit 9dbb207

Browse files
committed
Do not include name in JSON output
This makes is more similar to the web-service response.
1 parent 826b90e commit 9dbb207

File tree

3 files changed

+0
-12
lines changed

3 files changed

+0
-12
lines changed

src/Record/AbstractNamedRecord.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ public function __construct(array $record, array $locales = ['en'])
2929
public function jsonSerialize(): array
3030
{
3131
$js = [];
32-
if ($this->name !== null) {
33-
$js['name'] = $this->name;
34-
}
3532
if (!empty($this->names)) {
3633
$js['names'] = $this->names;
3734
}

tests/GeoIp2/Test/Model/CountryTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,16 @@ public function testJsonSerialize(): void
178178
$js =
179179
[
180180
'continent' => [
181-
'name' => 'North America',
182181
'names' => ['en' => 'North America'],
183182
'code' => 'NA',
184183
'geoname_id' => 42,
185184
],
186185
'country' => [
187-
'name' => 'United States of America',
188186
'names' => ['en' => 'United States of America'],
189187
'geoname_id' => 1,
190188
'iso_code' => 'US',
191189
],
192190
'registered_country' => [
193-
'name' => 'Germany',
194191
'names' => ['en' => 'Germany'],
195192
'geoname_id' => 2,
196193
'is_in_european_union' => true,

tests/GeoIp2/Test/Model/InsightsTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,11 @@ public function testFull(): void
235235
$this->assertSame(
236236
[
237237
'continent' => [
238-
'name' => 'North America',
239238
'names' => ['en' => 'North America'],
240239
'code' => 'NA',
241240
'geoname_id' => 42,
242241
],
243242
'country' => [
244-
'name' => 'United States of America',
245243
'names' => ['en' => 'United States of America'],
246244
'confidence' => 99,
247245
'geoname_id' => 1,
@@ -251,13 +249,11 @@ public function testFull(): void
251249
'queries_remaining' => 22,
252250
],
253251
'registered_country' => [
254-
'name' => 'Canada',
255252
'names' => ['en' => 'Canada'],
256253
'geoname_id' => 2,
257254
'iso_code' => 'CA',
258255
],
259256
'represented_country' => [
260-
'name' => 'United Kingdom',
261257
'names' => ['en' => 'United Kingdom'],
262258
'geoname_id' => 3,
263259
'iso_code' => 'GB',
@@ -288,7 +284,6 @@ public function testFull(): void
288284
'user_type' => 'college',
289285
],
290286
'city' => [
291-
'name' => 'Minneapolis',
292287
'names' => ['en' => 'Minneapolis'],
293288
'confidence' => 76,
294289
'geoname_id' => 9876,
@@ -308,7 +303,6 @@ public function testFull(): void
308303
],
309304
'subdivisions' => [
310305
[
311-
'name' => 'Minnesota',
312306
'names' => ['en' => 'Minnesota'],
313307
'confidence' => 88,
314308
'geoname_id' => 574635,

0 commit comments

Comments
 (0)