Skip to content

Commit 1477889

Browse files
committed
Tweaked changes from PR, included HTTP Response Factory
Fixes #148
1 parent 007358f commit 1477889

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"geocoder-php/geo-plugin-provider": "^4.0",
2828
"geocoder-php/google-maps-provider": "^4.0",
2929
"guzzlehttp/psr7": "*",
30+
"http-interop/http-factory-guzzle": "^1.0",
3031
"illuminate/cache": "5.0 - 5.8",
3132
"illuminate/support": "5.0 - 5.8",
3233
"php-http/curl-client": "*",

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
convertNoticesToExceptions="true"
99
convertWarningsToExceptions="true"
1010
processIsolation="false"
11-
stopOnFailure="false"
11+
stopOnFailure="true"
1212
>
1313
<testsuites>
1414
<testsuite name="Browser">

src/ProviderAndDumperAggregator.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,18 @@
99
* @license MIT License
1010
*/
1111

12-
use ReflectionClass;
13-
use Geocoder\Geocoder;
12+
use Geocoder\Dumper\GeoJson;
1413
use Geocoder\Dumper\Gpx;
1514
use Geocoder\Dumper\Kml;
1615
use Geocoder\Dumper\Wkb;
1716
use Geocoder\Dumper\Wkt;
18-
use Geocoder\Query\Query;
19-
use Illuminate\Support\Str;
20-
use Geocoder\Dumper\GeoJson;
17+
use Geocoder\Laravel\Exceptions\InvalidDumperException;
2118
use Geocoder\ProviderAggregator;
2219
use Geocoder\Query\GeocodeQuery;
2320
use Geocoder\Query\ReverseQuery;
2421
use Illuminate\Support\Collection;
25-
use Geocoder\Laravel\Exceptions\InvalidDumperException;
22+
use Illuminate\Support\Str;
23+
use ReflectionClass;
2624

2725
/**
2826
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
@@ -89,7 +87,7 @@ public function dump(string $dumper) : Collection
8987

9088
public function geocode(string $value) : self
9189
{
92-
$cacheKey = Str::slug(strtolower(urlencode($value)));
90+
$cacheKey = (new Str)->slug(strtolower(urlencode($value)));
9391
$this->results = $this->cacheRequest($cacheKey, [$value], "geocode");
9492

9593
return $this;
@@ -158,7 +156,7 @@ public function registerProvidersFromConfig(Collection $providers) : self
158156

159157
public function reverse(float $latitude, float $longitude) : self
160158
{
161-
$cacheKey = Str::slug(strtolower(urlencode("{$latitude}-{$longitude}")));
159+
$cacheKey = (new Str)->slug(strtolower(urlencode("{$latitude}-{$longitude}")));
162160
$this->results = $this->cacheRequest($cacheKey, [$latitude, $longitude], "reverse");
163161

164162
return $this;

tests/config/testConfig.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Geocoder\Provider\GeoIP2\GeoIP2;
1212
use Geocoder\Provider\GeoPlugin\GeoPlugin;
1313
use Geocoder\Provider\GoogleMaps\GoogleMaps;
14-
use Geocoder\Provider\HostIp\HostIp;
1514
use GeoIp2\Database\Reader;
1615
use Http\Client\Curl\Client;
1716

0 commit comments

Comments
 (0)