Skip to content

Commit 1844bc5

Browse files
committed
Remove igorw/get-in dependency to simplify code
1 parent 5cb30c7 commit 1844bc5

File tree

5 files changed

+4
-7
lines changed

5 files changed

+4
-7
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"homepage": "http://geocoder-php.org",
1919
"require": {
2020
"php": ">=8.2",
21-
"igorw/get-in": "^1.0",
2221
"php-http/discovery": "^1.17",
2322
"php-http/promise": "^1.0",
2423
"psr/http-client-implementation": "^1.0",

src/Provider/GeoPlugin/GeoPlugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ private function executeQuery(string $url): AddressCollection
8686

8787
$adminLevels = [];
8888

89-
$region = \igorw\get_in($data, ['geoplugin_regionName']);
90-
$regionCode = \igorw\get_in($data, ['geoplugin_regionCode']);
89+
$region = $data['geoplugin_regionName'] ?? null;
90+
$regionCode = $data['geoplugin_regionCode'] ?? null;
9191

9292
if (null !== $region || null !== $regionCode) {
9393
$adminLevels[] = ['name' => $region, 'code' => $regionCode, 'level' => 1];

src/Provider/GeoPlugin/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"require": {
1515
"php": "^8.0",
1616
"geocoder-php/common-http": "^4.0",
17-
"igorw/get-in": "^1.0",
1817
"willdurand/geocoder": "^4.0|^5.0"
1918
},
2019
"provide": {

src/Provider/MaxMind/MaxMind.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ private function replaceAdmins(array $data): array
146146
{
147147
$adminLevels = [];
148148

149-
$region = \igorw\get_in($data, ['region']);
150-
$regionCode = \igorw\get_in($data, ['regionCode']);
149+
$region = $data['region'] ?? null;
150+
$regionCode = $data['regionCode'] ?? null;
151151
unset($data['region'], $data['regionCode']);
152152

153153
if (null !== $region || null !== $regionCode) {

src/Provider/MaxMind/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
],
1414
"require": {
1515
"php": "^8.0",
16-
"igorw/get-in": "^1.0",
1716
"willdurand/geocoder": "^4.1|^5.0"
1817
},
1918
"provide": {

0 commit comments

Comments
 (0)